api ulangan
This commit is contained in:
29
src/features/objects/lib/api.ts
Normal file
29
src/features/objects/lib/api.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { BannersListData } from "@/features/objects/lib/data";
|
||||
import httpClient from "@/shared/config/api/httpClient";
|
||||
import { API_URLS } from "@/shared/config/api/URLs";
|
||||
import type { AxiosResponse } from "axios";
|
||||
|
||||
export const banner_api = {
|
||||
async list(params: {
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
}): Promise<AxiosResponse<BannersListData>> {
|
||||
const res = await httpClient.get(`${API_URLS.BannersList}`, { params });
|
||||
return res;
|
||||
},
|
||||
|
||||
async create(body: FormData) {
|
||||
const res = await httpClient.post(`${API_URLS.BannerCreate}`, body);
|
||||
return res;
|
||||
},
|
||||
|
||||
// async update({ body, id }: { id: number; body: ObjectUpdate }) {
|
||||
// const res = await httpClient.patch(`${API_URLS.OBJECT}${id}/update/`, body);
|
||||
// return res;
|
||||
// },
|
||||
|
||||
async delete(id: string) {
|
||||
const res = await httpClient.delete(`${API_URLS.BannerDelete(id)}`);
|
||||
return res;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user