MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / loader

Function loader

src/Components/Modify/Post/AddModifyPost.jsx:100–108  ·  view source on GitHub ↗
({params})

Source from the content-addressed store, hash-verified

98}
99
100export 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
110export async function action({request, params}) {
111 const formData = await request.formData();

Callers

nothing calls this directly

Calls 3

decodePathParamFunction · 0.90
getPostObjectFunction · 0.90
getDisplayNameFunction · 0.90

Tested by

no test coverage detected