Files
memegoat/frontend/src/services/user.service.ts
Mathis HERRIOT 35abd0496e
Some checks failed
Deploy to Production / deploy (push) Failing after 2m20s
Lint / lint (push) Successful in 9m37s
refactor: apply consistent formatting to improve code quality
Ensure uniform code formatting across components by aligning with the established code style. Adjust imports, indentation, and spacing to enhance readability and maintainability.
2026-01-14 17:26:58 +01:00

20 lines
489 B
TypeScript

import api from "@/lib/api";
import type { User } from "@/types/user";
export const UserService = {
async getMe(): Promise<User> {
const { data } = await api.get<User>("/users/me");
return data;
},
async getProfile(username: string): Promise<User> {
const { data } = await api.get<User>(`/users/public/${username}`);
return data;
},
async updateMe(update: Partial<User>): Promise<User> {
const { data } = await api.patch<User>("/users/me", update);
return data;
},
};