hezarfen_frontend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import { client } from "../client"; |
| 2 | import type { Role } from "../client"; |
| 3 | |
| 4 | export type RegisterBody = { |
| 5 | school: string; |
| 6 | username: string; |
| 7 | password: string; |
| 8 | }; |
| 9 | |
| 10 | /** Backend answers 201 {username, role} only — anti-enumeration, no id. */ |
| 11 | export type RegisterResponse = { |
| 12 | username: string; |
| 13 | role: Role; |
| 14 | }; |
| 15 | |
| 16 | export function postRegister(body: RegisterBody): Promise<RegisterResponse> { |
| 17 | return client<RegisterResponse>("/auth/register", { method: "POST", body }); |
| 18 | } |