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.
51 lines
1.4 KiB
51 lines
1.4 KiB
1 month ago
|
import apiService from './apiClient';
|
||
|
|
||
|
export interface Country {
|
||
|
name: string,
|
||
|
country: number,
|
||
|
currency: string,
|
||
|
timezone: string,
|
||
|
language: string,
|
||
|
user_count: number,
|
||
|
name_en:string
|
||
|
}
|
||
|
|
||
|
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),
|
||
|
}
|