base con autenticacion, registro, modulo encuestas
This commit is contained in:
16
apps/web/feactures/location/hooks/use-query-location.ts
Normal file
16
apps/web/feactures/location/hooks/use-query-location.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
'use client'
|
||||
import { useSafeQuery } from "@/hooks/use-safe-query";
|
||||
import { getStateAction, getMunicipalityAction, getParishAction } from "../actions/actions";
|
||||
|
||||
// Hook for users
|
||||
export function useStateQuery() {
|
||||
return useSafeQuery(['state'], () => getStateAction())
|
||||
}
|
||||
|
||||
export function useMunicipalityQuery( stateId : number ) {
|
||||
return useSafeQuery(['municipality', stateId], () => getMunicipalityAction(stateId))
|
||||
}
|
||||
|
||||
export function useParishQuery(municipalityId : number) {
|
||||
return useSafeQuery(['parish', municipalityId], () => getParishAction(municipalityId))
|
||||
}
|
||||
Reference in New Issue
Block a user