hezarfen_frontend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import { client } from "../client"; |
| 2 | import type { User } from "../client"; |
| 3 | |
| 4 | export type LoginBody = { |
| 5 | username: string; |
| 6 | password: string; |
| 7 | }; |
| 8 | |
| 9 | export type SchoolChoice = { |
| 10 | slug: string; |
| 11 | name: string; |
| 12 | }; |
| 13 | |
| 14 | export type SchoolChoiceResponse = { |
| 15 | username: string; |
| 16 | schools: SchoolChoice[]; |
| 17 | }; |
| 18 | |
| 19 | export type LoginResponse = User | SchoolChoiceResponse; |
| 20 | |
| 21 | export function postLogin(body: LoginBody): Promise<LoginResponse> { |
| 22 | return client<LoginResponse>("/auth/login", { method: "POST", body }); |
| 23 | } |