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