MCPcopy Create free account
hub / github.com/dailydotdev/apps / updateCommentContentPreference

Function updateCommentContentPreference

packages/shared/src/lib/query.ts:594–620  ·  view source on GitHub ↗
({
  data,
  status,
  entity,
  entityId,
}: {
  data: PostComment;
  status: ContentPreferenceStatus | null;
  entityId: string;
  entity: ContentPreferenceType;
})

Source from the content-addressed store, hash-verified

592};
593
594export const updateCommentContentPreference = ({
595 data,
596 status,
597 entity,
598 entityId,
599}: {
600 data: PostComment;
601 status: ContentPreferenceStatus | null;
602 entityId: string;
603 entity: ContentPreferenceType;
604}): PostComment => {
605 if (typeof status === 'undefined') {
606 return data;
607 }
608
609 const newData = structuredClone(data);
610
611 if (newData.author?.id === entityId) {
612 newData.author = updateAuthorContentPreference({
613 data: newData.author,
614 status,
615 entity,
616 });
617 }
618
619 return newData;
620};
621
622type QueryKeyReturnType = ReturnType<typeof generateQueryKey>;
623

Calls 1

Tested by

no test coverage detected