* replace next with vite * disable strictmode (it interferes with collaboration in dev mode)
19 lines
571 B
TypeScript
19 lines
571 B
TypeScript
import api from '@/lib/api-client';
|
|
import { ICurrentUserResponse, IUser } from '@/features/user/types/user.types';
|
|
|
|
export async function getMe(): Promise<IUser> {
|
|
const req = await api.get<IUser>('/user/me');
|
|
return req.data as IUser;
|
|
}
|
|
|
|
export async function getUserInfo(): Promise<ICurrentUserResponse> {
|
|
const req = await api.get<ICurrentUserResponse>('/user/info');
|
|
return req.data as ICurrentUserResponse;
|
|
}
|
|
|
|
export async function updateUser(data: Partial<IUser>) {
|
|
const req = await api.post<IUser>('/user/update', data);
|
|
|
|
return req.data as IUser;
|
|
}
|