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

Function updateCommentContentPreference

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

553};
554
555export const updateCommentContentPreference = ({
556 data,
557 status,
558 entity,
559 entityId,
560}: {
561 data: PostComment;
562 status: ContentPreferenceStatus | null;
563 entityId: string;
564 entity: ContentPreferenceType;
565}): PostComment => {
566 if (typeof status === 'undefined') {
567 return data;
568 }
569
570 const newData = structuredClone(data);
571
572 if (newData.author?.id === entityId) {
573 newData.author = updateAuthorContentPreference({
574 data: newData.author,
575 status,
576 entity,
577 });
578 }
579
580 return newData;
581};
582
583type QueryKeyReturnType = ReturnType<typeof generateQueryKey>;
584

Calls 1

Tested by

no test coverage detected