MCPcopy Index your code
hub / github.com/OpenSIST/OpenSIST.github.io / getPostThread

Function getPostThread

src/Data/PostData.js:66–79  ·  view source on GitHub ↗
(postId)

Source from the content-addressed store, hash-verified

64}
65
66export async function getPostThread(postId) {
67 try {
68 const postResult = await apiJson(GET_CONTENT_API, {body: {postId}});
69 return {
70 post: normalizePostContent(postResult.post),
71 comments: (postResult.comments ?? []).map(normalizePostContent),
72 };
73 } catch (e) {
74 if (e.status === 404) {
75 throw new Error('Post not found');
76 }
77 throw e;
78 }
79}
80
81export async function getPost(postId) {
82 return (await getPostThread(postId)).post;

Callers 2

loaderFunction · 0.90
getPostFunction · 0.85

Calls 2

apiJsonFunction · 0.90
normalizePostContentFunction · 0.85

Tested by

no test coverage detected