({
postId,
sortBy,
}: GenerateCommentsQueryKeyProps)
| 588 | } |
| 589 | |
| 590 | export const generateCommentsQueryKey = ({ |
| 591 | postId, |
| 592 | sortBy, |
| 593 | }: GenerateCommentsQueryKeyProps): QueryKeyReturnType => |
| 594 | generateQueryKey( |
| 595 | RequestKey.PostComments, |
| 596 | undefined, |
| 597 | // Filter out undefined to ensure key matches after JSON serialization |
| 598 | Object.fromEntries( |
| 599 | Object.entries({ postId, sortBy }).filter(([, v]) => v !== undefined), |
| 600 | ), |
| 601 | ); |
| 602 | |
| 603 | export const getAllCommentsQuery = (postId: string): QueryKeyReturnType[] => { |
| 604 | const sorting = Object.values(SortCommentsBy).map((sortBy) => |
no test coverage detected