update new api reques and response
This commit is contained in:
21
src/features/support/lib/api.ts
Normal file
21
src/features/support/lib/api.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { SupportListRes } from "@/features/support/lib/data";
|
||||
import httpClient from "@/shared/config/api/httpClient";
|
||||
import { SUPPORT } from "@/shared/config/api/URLs";
|
||||
import type { AxiosResponse } from "axios";
|
||||
|
||||
export const support_api = {
|
||||
async list(): Promise<AxiosResponse<SupportListRes>> {
|
||||
const res = await httpClient.get(`${SUPPORT}list/`);
|
||||
return res;
|
||||
},
|
||||
|
||||
async send(body: {
|
||||
district_id?: number;
|
||||
problem: string;
|
||||
date: string;
|
||||
type: "PROBLEM" | "HELP";
|
||||
}) {
|
||||
const res = await httpClient.post(`${SUPPORT}send/`, body);
|
||||
return res;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user