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

Function updateCommentContentPreference

packages/shared/src/lib/query.ts:593–619  ·  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

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

Calls 1

Tested by

no test coverage detected