complated project
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
MyAdsData,
|
||||
MyAdsDataRes,
|
||||
MyBonusesData,
|
||||
NotificationListRes,
|
||||
UserInfoResponseData,
|
||||
} from './type';
|
||||
|
||||
@@ -35,6 +36,8 @@ export const user_api = {
|
||||
person_type: 'employee' | 'legal_entity' | 'ytt' | 'band';
|
||||
phone: string;
|
||||
activate_types: number[];
|
||||
age: number;
|
||||
gender: 'male' | 'female';
|
||||
}) {
|
||||
const res = await httpClient.patch(API_URLS.User_Update, body);
|
||||
return res;
|
||||
@@ -105,4 +108,32 @@ export const user_api = {
|
||||
const res = await httpClient.get(API_URLS.Detail_Products(id));
|
||||
return res;
|
||||
},
|
||||
|
||||
async my_referrals(params: { page: number; page_size: number }) {
|
||||
const res = await httpClient.get(API_URLS.My_Refferals, { params });
|
||||
return res;
|
||||
},
|
||||
|
||||
async create_referral(body: {
|
||||
code: string;
|
||||
referral_share: number;
|
||||
description: string;
|
||||
is_agent: boolean;
|
||||
}) {
|
||||
const res = await httpClient.post(API_URLS.My_Refferals, body);
|
||||
return res;
|
||||
},
|
||||
|
||||
async notification_list(params: {
|
||||
page: number;
|
||||
page_size: number;
|
||||
}): Promise<AxiosResponse<NotificationListRes>> {
|
||||
const res = await httpClient.get(API_URLS.Notification_List, { params });
|
||||
return res;
|
||||
},
|
||||
|
||||
async is_ready_id(id: number) {
|
||||
const res = await httpClient.post(API_URLS.Notification_Ready(id));
|
||||
return res;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -77,6 +77,8 @@ export interface UserInfoResponseData {
|
||||
company_image: null | string;
|
||||
address: null | string;
|
||||
district: number;
|
||||
age: null | number;
|
||||
gender: 'male' | 'female' | null;
|
||||
parent: null | string;
|
||||
user_tg_ids: number[];
|
||||
};
|
||||
@@ -166,3 +168,30 @@ export interface MyBonusesDataRes {
|
||||
percent: number;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface NotificationListRes {
|
||||
status: boolean;
|
||||
data: {
|
||||
links: {
|
||||
previous: null | string;
|
||||
next: null | string;
|
||||
};
|
||||
total_items: number;
|
||||
total_pages: number;
|
||||
page_size: number;
|
||||
current_page: number;
|
||||
unread_count: number;
|
||||
|
||||
results: NotificationListDataRes[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface NotificationListDataRes {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
is_send: boolean;
|
||||
is_read: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user