view models

This commit is contained in:
2025-12-18 13:48:35 +01:00
parent cc2553876a
commit 91adbb9c83
71 changed files with 3119 additions and 359 deletions

View File

@@ -1,9 +1,9 @@
import { BaseApiClient } from '../base/BaseApiClient';
import type {
LoginParamsDto,
SignupParamsDto,
SessionDataDto,
} from '../../dtos';
import { AuthSessionDTO } from '../../types/generated/AuthSessionDTO';
// TODO: Create DTOs for login/signup params in apps/website/lib/types/generated
type LoginParamsDto = { email: string; password: string };
type SignupParamsDto = { email: string; password: string; displayName: string };
/**
* Auth API Client
@@ -12,18 +12,18 @@ import type {
*/
export class AuthApiClient extends BaseApiClient {
/** Sign up with email */
signup(params: SignupParamsDto): Promise<SessionDataDto> {
return this.post<SessionDataDto>('/auth/signup', params);
signup(params: SignupParamsDto): Promise<AuthSessionDTO> {
return this.post<AuthSessionDTO>('/auth/signup', params);
}
/** Login with email */
login(params: LoginParamsDto): Promise<SessionDataDto> {
return this.post<SessionDataDto>('/auth/login', params);
login(params: LoginParamsDto): Promise<AuthSessionDTO> {
return this.post<AuthSessionDTO>('/auth/login', params);
}
/** Get current session */
getSession(): Promise<SessionDataDto | null> {
return this.get<SessionDataDto | null>('/auth/session');
getSession(): Promise<AuthSessionDTO | null> {
return this.get<AuthSessionDTO | null>('/auth/session');
}
/** Logout */