(
id: string,
upvotes: number,
type: UpvoteType = 'post',
)
| 27 | export const useUpvoteQuery = (): UseUpvoteQuery => { |
| 28 | const { modal, openModal } = useLazyModal<LazyModal.UpvotedPopup>(); |
| 29 | const onShowUpvoted = ( |
| 30 | id: string, |
| 31 | upvotes: number, |
| 32 | type: UpvoteType = 'post', |
| 33 | ) => { |
| 34 | openModal({ |
| 35 | type: LazyModal.UpvotedPopup, |
| 36 | props: { |
| 37 | placeholderAmount: upvotes, |
| 38 | requestQuery: { |
| 39 | queryKey: [KEY_MAP[type], id], |
| 40 | query: QUERY_MAP[type], |
| 41 | params: { id, first: DEFAULT_UPVOTES_PER_PAGE }, |
| 42 | }, |
| 43 | }, |
| 44 | }); |
| 45 | }; |
| 46 | |
| 47 | return useMemo( |
| 48 | () => ({ onShowUpvoted, queryKey: modal?.props?.requestQuery?.queryKey }), |
no outgoing calls
no test coverage detected