forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

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

postLogin.ts23 lines, 501 bytesHistoryRawDownload
1import { client } from "../client";
2import type { User } from "../client";
3
4export type LoginBody = {
5 username: string;
6 password: string;
7};
8
9export type SchoolChoice = {
10 slug: string;
11 name: string;
12};
13
14export type SchoolChoiceResponse = {
15 username: string;
16 schools: SchoolChoice[];
17};
18
19export type LoginResponse = User | SchoolChoiceResponse;
20
21export function postLogin(body: LoginBody): Promise<LoginResponse> {
22 return client<LoginResponse>("/auth/login", { method: "POST", body });
23}