このコミットが含まれているのは:
2026-07-18 02:29:55 +09:00
コミット e6c3c635b8
11個のファイルの変更134行の追加54行の削除
+5 -1
ファイルの表示
@@ -137,6 +137,7 @@ class PostsController < ApplicationController
video_ms: nil,
field_warnings: { },
base_warnings: [],
existing_post_id: existing_post.id,
existing_post: compact_post(existing_post.id) }
end
@@ -158,6 +159,7 @@ class PostsController < ApplicationController
video_ms: metadata[:video_ms],
field_warnings: field_warnings,
base_warnings: [],
existing_post_id: nil,
existing_post: nil }
rescue ArgumentError => e
render_bad_request e.message
@@ -177,6 +179,7 @@ class PostsController < ApplicationController
video_ms: nil,
field_warnings: { url: ['自動取得に失敗しました.'] },
base_warnings: [],
existing_post_id: nil,
existing_post: nil }
end
@@ -212,7 +215,7 @@ class PostsController < ApplicationController
attributes: post_create_attributes,
thumbnail: params[:thumbnail]).run
return render json: dry_run_json(preflight) if bool?(:dry)
if preflight[:existing_post].present?
if preflight[:existing_post_id].present?
post = Post.new(url: preflight[:url])
post.errors.add :url, :taken
return render_post_form_record_invalid post
@@ -637,6 +640,7 @@ class PostsController < ApplicationController
:video_ms,
:field_warnings,
:base_warnings,
:existing_post_id,
:existing_post)
end