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