13 lines
460 B
TypeScript
13 lines
460 B
TypeScript
import { api } from "./client";
|
|
import type { Profile, ProfileRequest } from "./types";
|
|
|
|
/** 讀取目前登入使用者的個人資料。 */
|
|
export function getProfile(): Promise<Profile> {
|
|
return api.get("v1/me/profile").json<Profile>();
|
|
}
|
|
|
|
/** 建立或完整更新目前登入使用者的個人資料。 */
|
|
export function updateProfile(request: ProfileRequest): Promise<Profile> {
|
|
return api.put("v1/me/profile", { json: request }).json<Profile>();
|
|
}
|