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