apilar ulandi
This commit is contained in:
@@ -4,7 +4,7 @@ import type {
|
||||
UpdatePharmaciesReq,
|
||||
} from "@/features/pharmacies/lib/data";
|
||||
import httpClient from "@/shared/config/api/httpClient";
|
||||
import { PHARMACIES } from "@/shared/config/api/URLs";
|
||||
import { API_URLS } from "@/shared/config/api/URLs";
|
||||
import type { AxiosResponse } from "axios";
|
||||
|
||||
export const pharmacies_api = {
|
||||
@@ -16,22 +16,25 @@ export const pharmacies_api = {
|
||||
district?: string;
|
||||
user?: string;
|
||||
}): Promise<AxiosResponse<PharmaciesListRes>> {
|
||||
const res = await httpClient.get(`${PHARMACIES}list/`, { params });
|
||||
const res = await httpClient.get(`${API_URLS.PHARMACIES}list/`, { params });
|
||||
return res;
|
||||
},
|
||||
|
||||
async create(body: CreatePharmaciesReq) {
|
||||
const res = await httpClient.post(`${PHARMACIES}create/`, body);
|
||||
const res = await httpClient.post(`${API_URLS.PHARMACIES}create/`, body);
|
||||
return res;
|
||||
},
|
||||
|
||||
async update({ body, id }: { id: number; body: UpdatePharmaciesReq }) {
|
||||
const res = await httpClient.patch(`${PHARMACIES}${id}/update/`, body);
|
||||
const res = await httpClient.patch(
|
||||
`${API_URLS.PHARMACIES}${id}/update/`,
|
||||
body,
|
||||
);
|
||||
return res;
|
||||
},
|
||||
|
||||
async delete(id: number) {
|
||||
const res = await httpClient.delete(`${PHARMACIES}${id}/delete/`);
|
||||
const res = await httpClient.delete(`${API_URLS.PHARMACIES}${id}/delete/`);
|
||||
return res;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user