diff --git a/src/lib/api.ts b/src/lib/api.ts index 413c990..d5cc5d8 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -134,6 +134,13 @@ export async function login(username: string, password: string, cookies?: Cookie }, cookies); } +export async function register(username: string, password: string, cookies?: Cookies): Promise { + return apiFetch('/user/register', { + method: 'POST', + body: JSON.stringify({ username, password }), + }, cookies); +} + // Get user data function with type annotation for the response export async function getUserData(token: string): Promise { return apiFetch('/user/me', {