feat: 投稿にニコタグ追加できてしまふバグ修正(#125) (#236)
#125 #125 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #236
This commit was merged in pull request #236.
This commit is contained in:
@@ -81,8 +81,6 @@ class PostsController < ApplicationController
|
||||
return head :unauthorized unless current_user
|
||||
return head :forbidden unless current_user.member?
|
||||
|
||||
# TODO: URL が正規のものがチェック,不正ならエラー
|
||||
# TODO: URL は必須にする(タイトルは省略可).
|
||||
# TODO: サイトに応じて thumbnail_base 設定
|
||||
title = params[:title].presence
|
||||
url = params[:url]
|
||||
@@ -105,6 +103,8 @@ class PostsController < ApplicationController
|
||||
else
|
||||
render json: { errors: post.errors.full_messages }, status: :unprocessable_entity
|
||||
end
|
||||
rescue Tag::NicoTagNormalisationError
|
||||
head :bad_request
|
||||
end
|
||||
|
||||
def viewed
|
||||
@@ -142,6 +142,8 @@ class PostsController < ApplicationController
|
||||
else
|
||||
render json: post.errors, status: :unprocessable_entity
|
||||
end
|
||||
rescue Tag::NicoTagNormalisationError
|
||||
head :bad_request
|
||||
end
|
||||
|
||||
def changes
|
||||
|
||||
Reference in New Issue
Block a user