forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB0069847Burak Boduroğlu2 months ago552 commits

postRegister.ts18 lines, 475 bytesHistoryRawDownload
1import { client } from "../client";
2import type { Role } from "../client";
3
4export type RegisterBody = {
5 school: string;
6 username: string;
7 password: string;
8};
9
10/** Backend answers 201 {username, role} only — anti-enumeration, no id. */
11export type RegisterResponse = {
12 username: string;
13 role: Role;
14};
15
16export function postRegister(body: RegisterBody): Promise<RegisterResponse> {
17 return client<RegisterResponse>("/auth/register", { method: "POST", body });
18}