added userDtos
All checks were successful
Build and Deploy Frontend / build-and-deploy (push) Successful in 7s
Build and Deploy API / build-and-deploy (push) Successful in 10s

This commit is contained in:
2026-03-28 00:01:45 -05:00
parent 5afd9057f2
commit f271ff59f8
11 changed files with 97 additions and 71 deletions

View File

@@ -1,11 +1,11 @@
import api from "./axios.ts"
import type { User } from "../models/User.ts";
import type { UserDto } from "../models/User.ts";
const API_URL: string = "/users";
export const getUsers = () => api.get<User[]>(`${API_URL}`);
export const getUsers = () => api.get<UserDto[]>(`${API_URL}`);
export const getUser = (id: number) => api.get<User>(`${API_URL}/${id}`);
export const getUser = (id: string) => api.get<UserDto>(`${API_URL}/${id}`);
export const deleteUser = (id: number) => api.delete<User>(`${API_URL}/${id}`);
export const deleteUser = (id: string) => api.delete<UserDto>(`${API_URL}/${id}`);