forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

postMyAvatar.ts10 lines, 432 bytesHistoryRawDownload
1import { formClient } from "../client";
2import type { AvatarMeta } from "../client";
3
4// PNG, JPEG, WebP or GIF only — no SVG — under the school's max_file_bytes.
5// Uploading over an existing avatar replaces it.
6export function postMyAvatar(file: File, signal?: AbortSignal): Promise<AvatarMeta> {
7 const body = new FormData();
8 body.append("file", file);
9 return formClient<AvatarMeta>("/users/me/avatar", body, signal);
10}