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

Function getPosts

src/Data/PostData.js:53–64  ·  view source on GitHub ↗
(query = {})

Source from the content-addressed store, hash-verified

51 try {
52 const postResult = await apiJson(GET_CONTENT_API, {body: {postId}});
53 return {
54 post: normalizePostContent(postResult.post),
55 comments: (postResult.comments ?? []).map(normalizePostContent),
56 };
57 } catch (e) {
58 if (e.status === 404) {
59 throw new Error('Post not found');
60 }
61 throw e;
62 }
63}
64
65export async function getPost(postId) {
66 return (await getPostThread(postId)).post;
67}

Callers 2

loaderFunction · 0.90
StatsBlockFunction · 0.90

Calls 1

apiJsonFunction · 0.90

Tested by

no test coverage detected