You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import apiService from './apiClient';
|
|
|
|
|
|
|
|
export interface Country {
|
|
|
|
country: number;
|
|
|
|
currency: string;
|
|
|
|
language: string;
|
|
|
|
name: number;
|
|
|
|
name_en:string
|
|
|
|
phoneCode: string;
|
|
|
|
timezone:string,
|
|
|
|
user_count:number
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FirstLogin {
|
|
|
|
currency: string,
|
|
|
|
language: string,
|
|
|
|
country: number,
|
|
|
|
theme: string,
|
|
|
|
timezone: string,
|
|
|
|
notifications_enabled: number,
|
|
|
|
email_notifications: number,
|
|
|
|
sms_notifications: number,
|
|
|
|
setting_id: number,
|
|
|
|
user_id: number,
|
|
|
|
create_time: string,
|
|
|
|
update_time: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MySetting {
|
|
|
|
currency: string,
|
|
|
|
language: string,
|
|
|
|
country: number,
|
|
|
|
theme: string,
|
|
|
|
timezone: string,
|
|
|
|
notifications_enabled: number,
|
|
|
|
email_notifications: number,
|
|
|
|
sms_notifications: number,
|
|
|
|
setting_id: number,
|
|
|
|
user_id: number,
|
|
|
|
create_time: string,
|
|
|
|
update_time: string
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const settingApi = {
|
|
|
|
getCountryList: () => apiService.get<Country[]>('/api/user_settings/countries/'),
|
|
|
|
getCurrencyList: () => apiService.get<string[]>('/api/user_settings/currencies/'),
|
|
|
|
getLanguageList: () => apiService.get<string[]>('/api/user_settings/languages/'),
|
|
|
|
getMySetting: () => apiService.get<MySetting>('/api/user_settings/me/'),
|
|
|
|
postFirstLogin: (country: number) => apiService.post<FirstLogin>(`/api/user_settings/first_login/?country=${country}`),
|
|
|
|
putSetting: (setting: object) => apiService.put<MySetting>('/api/user_settings/me/', setting),
|
|
|
|
}
|