({
postId,
sortBy,
}: GenerateCommentsQueryKeyProps)
| 617 | } |
| 618 | |
| 619 | export const generateCommentsQueryKey = ({ |
| 620 | postId, |
| 621 | sortBy, |
| 622 | }: GenerateCommentsQueryKeyProps): QueryKeyReturnType => |
| 623 | generateQueryKey( |
| 624 | RequestKey.PostComments, |
| 625 | undefined, |
| 626 | // Filter out undefined to ensure key matches after JSON serialization |
| 627 | Object.fromEntries( |
| 628 | Object.entries({ postId, sortBy }).filter(([, v]) => v !== undefined), |
| 629 | ), |
| 630 | ); |
| 631 | |
| 632 | export const getAllCommentsQuery = (postId: string): QueryKeyReturnType[] => { |
| 633 | const sorting = Object.values(SortCommentsBy).map((sortBy) => |
no test coverage detected