Fix response code for post creation

This commit is contained in:
2024-02-24 09:15:13 +11:00
parent c57cb62917
commit 13577aa538

View File

@@ -31,10 +31,10 @@ module Micropub
# create
if req_entity && verify_scope(req: req, scope: :create)
create_entry.call(req_entity: req_entity) do |m|
Dry::Matcher::ResultMatcher.(create_entry.call(req_entity: req_entity)) do |m|
m.success do |post|
res.headers["Location"] = "#{settings.micropub_site_url}/#{post.value!.post_type}/#{post.value!.slug}"
res.status = 201
res.headers["Location"] = "#{settings.micropub_site_url}/#{post.post_type}/#{post.slug}"
end
m.failure do |validation|