| 123456789101112131415161718 |
- import { createCachedApi } from "./cacheService";
- const api = createCachedApi("state");
- export const getState = async (id) => {
- const { data } = await api.get("/state/" + id);
- return data.payload;
- }
- export const getStates = async () => {
- const { data } = await api.get("/state");
- return data.payload;
- }
- export const getStateByCountry = async (countryId) => {
- const { data } = await api.get(`/state/country/${countryId}`);
- return data.payload;
- }
|