doctor list
This commit is contained in:
20
src/features/doctors/lib/api.ts
Normal file
20
src/features/doctors/lib/api.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { DoctorListRes } from "@/features/doctors/lib/data";
|
||||
import httpClient from "@/shared/config/api/httpClient";
|
||||
import { DOCTOR } from "@/shared/config/api/URLs";
|
||||
import type { AxiosResponse } from "axios";
|
||||
|
||||
export const doctor_api = {
|
||||
async list(params: {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
full_name?: string;
|
||||
district_name?: string;
|
||||
place_name?: string;
|
||||
work_place?: string;
|
||||
sphere?: string;
|
||||
user?: string;
|
||||
}): Promise<AxiosResponse<DoctorListRes>> {
|
||||
const res = await httpClient.get(`${DOCTOR}list/`, { params });
|
||||
return res;
|
||||
},
|
||||
};
|
||||
@@ -50,3 +50,45 @@ export const doctorListData: DoctorListType[] = [
|
||||
long: ObjectListData[1].long,
|
||||
},
|
||||
];
|
||||
|
||||
export interface DoctorListRes {
|
||||
status_code: number;
|
||||
status: string;
|
||||
message: string;
|
||||
data: {
|
||||
count: number;
|
||||
next: string;
|
||||
previous: string;
|
||||
results: DoctorListResData[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface DoctorListResData {
|
||||
id: number;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
phone_number: string;
|
||||
work_place: string;
|
||||
sphere: string;
|
||||
description: string;
|
||||
district: {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
place: {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
user: {
|
||||
id: number;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
};
|
||||
longitude: number;
|
||||
latitude: number;
|
||||
extra_location: {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
};
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user