15 lines
717 B
TypeScript
15 lines
717 B
TypeScript
import { api } from "src/boot/axios";
|
|
import type { Preferences } from "src/modules/profile/models/preferences.models";
|
|
import type { BackendResponse } from "src/modules/shared/models/backend-response.models";
|
|
|
|
export const ProfileService = {
|
|
getUserPreferences: async (): Promise<BackendResponse<Preferences>> => {
|
|
const response = await api.get<BackendResponse<Preferences>>(`/preferences`);
|
|
return response.data;
|
|
},
|
|
|
|
updateUserPreferences: async (new_preferences: Preferences): Promise<BackendResponse<Preferences>> => {
|
|
const response = await api.patch<BackendResponse<Preferences>>(`/preferences/update`, new_preferences);
|
|
return response.data;
|
|
},
|
|
}; |