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

Function updateCommentContentPreference

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

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

Calls 1

Tested by

no test coverage detected