This commit is contained in:
gili8420 2026-08-14 00:01:49 +09:00
commit b43955e0d9
162 changed files with 15425 additions and 0 deletions

20
src/lib/api/profile.ts Normal file
View file

@ -0,0 +1,20 @@
import { api } from './client';
export interface UserProfile {
username: string;
email: string;
first_name: string;
last_name: string;
}
export type ProfilePatch = Partial<Pick<UserProfile, 'email' | 'first_name' | 'last_name'>>;
export const profileApi = {
get: () => api.get<UserProfile>('/profile/'),
update: (patch: ProfilePatch) => api.patch<UserProfile>('/profile/', patch),
changePassword: (old_password: string, new_password: string) =>
api.post<{ detail: string }>('/profile/change-password/', { old_password, new_password }),
deleteData: () => api.del<{ detail: string }>('/profile/delete-data/'),
deleteAccount: (password: string) =>
api.del<{ detail: string }>('/profile/delete-account/', { password })
};