Fix response code for post creation
This commit is contained in:
@@ -31,10 +31,10 @@ module Micropub
|
|||||||
|
|
||||||
# create
|
# create
|
||||||
if req_entity && verify_scope(req: req, scope: :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|
|
m.success do |post|
|
||||||
|
res.headers["Location"] = "#{settings.micropub_site_url}/#{post.value!.post_type}/#{post.value!.slug}"
|
||||||
res.status = 201
|
res.status = 201
|
||||||
res.headers["Location"] = "#{settings.micropub_site_url}/#{post.post_type}/#{post.slug}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
m.failure do |validation|
|
m.failure do |validation|
|
||||||
|
Reference in New Issue
Block a user