AI: #439 投稿の “閲覧済” を冪等にする #468

オープン
テツノニジカ が feature/439 から main への 2 コミットのマージを希望しています
コミット b7d92b7ddd の変更だけを表示しています - すべてのコミットを表示
+3 -1
ファイルの表示
@@ -314,7 +314,9 @@ class PostsController < ApplicationController
def viewed
return head :unauthorized unless current_user
current_user.viewed_posts << Post.find(params[:id])
UserPostView.create_or_find_by!(
user: current_user,
post: Post.find(params[:id]))
head :no_content
end