Ensure uniform code formatting across components by aligning with the established code style. Adjust imports, indentation, and spacing to enhance readability and maintainability.
20 lines
489 B
TypeScript
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;
|
|
},
|
|
};
|