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

Function updateCommentContentPreference

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

575};
576
577export const updateCommentContentPreference = ({
578 data,
579 status,
580 entity,
581 entityId,
582}: {
583 data: PostComment;
584 status: ContentPreferenceStatus | null;
585 entityId: string;
586 entity: ContentPreferenceType;
587}): PostComment => {
588 if (typeof status === 'undefined') {
589 return data;
590 }
591
592 const newData = structuredClone(data);
593
594 if (newData.author?.id === entityId) {
595 newData.author = updateAuthorContentPreference({
596 data: newData.author,
597 status,
598 entity,
599 });
600 }
601
602 return newData;
603};
604
605type QueryKeyReturnType = ReturnType<typeof generateQueryKey>;
606

Calls 1

Tested by

no test coverage detected