({params})
| 98 | } |
| 99 | |
| 100 | export async function loader({params}) { |
| 101 | const postId = decodePathParam(params?.postId); |
| 102 | const postObj = postId ? await getPostObject(postId) : null; |
| 103 | const displayName = await getDisplayName(); |
| 104 | if (postObj && postObj.author !== displayName) { |
| 105 | throw new Error(`Sorry, you are not authorized to edit this post.`); |
| 106 | } |
| 107 | return {postObj}; |
| 108 | } |
| 109 | |
| 110 | export async function action({request, params}) { |
| 111 | const formData = await request.formData(); |
nothing calls this directly
no test coverage detected