refactor(client): split client to cms/mobile/party
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
18
client/cms/src/hooks/data/useGetCheckInCode.ts
Normal file
18
client/cms/src/hooks/data/useGetCheckInCode.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { axiosClient } from '@/lib/axios';
|
||||
|
||||
export function useCheckinCode(eventId: string, enabled: boolean) {
|
||||
return useQuery({
|
||||
queryKey: ['getCheckinCode', eventId],
|
||||
queryFn: async () => {
|
||||
return axiosClient.get<{
|
||||
checkin_code: string;
|
||||
}>('/user/checkin', {
|
||||
params: {
|
||||
event_id: eventId,
|
||||
},
|
||||
});
|
||||
},
|
||||
enabled,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user