user dtos as strict object templates
Some checks failed
Build and Deploy API / build-and-deploy (push) Failing after 6s
Build and Deploy Frontend / build-and-deploy (push) Successful in 7s

This commit is contained in:
2026-03-20 21:08:32 -05:00
parent 7229e369ae
commit 109d5f88ea
7 changed files with 28 additions and 29 deletions

View File

@@ -3,11 +3,11 @@
// handles user registration, user logins, tokens, password reset, etc.
import api from "./axios.ts"
import type { User } from "../models/User.ts";
import type { User, RegisterDto, LoginDto } from "../models/User.ts";
const API_URL: string = "/auth";
export const register = async (user: { username: string; email: string; password: string }) => {
export const register = async (user: RegisterDto) => {
try {
const response = await api.post(`${API_URL}/register`, user);
@@ -24,7 +24,7 @@ export const register = async (user: { username: string; email: string; password
}
export const login = async (user: { username: string; password: string }) => {
export const login = async (user: LoginDto ) => {
try {
const response = await api.post(`${API_URL}/login`, user);