change users crud to items
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
|
||||
// services are kinda whatever, but in general its a good idea for all api calls to be within a service (at least thats how angular handles it)
|
||||
// this user service will handle all to <-> from the server when handling user objects
|
||||
|
||||
import api from "./axios.ts"
|
||||
import type { User } from "../models/User.ts";
|
||||
|
||||
const API_URL: string = "/users";
|
||||
|
||||
export const getUsers = () => api.get<User[]>(`${API_URL}`);
|
||||
|
||||
export const getUser = (id: number) => api.get<User>(`${API_URL}/${id}`);
|
||||
|
||||
export const createUser = (data: User) => api.post<User>(`${API_URL}`, data);
|
||||
|
||||
export const updateUser = (id: number, data: User) => api.put<User>(`${API_URL}/${id}`, data);
|
||||
|
||||
export const deleteUser = (id: number) => api.delete<User>(`${API_URL}/${id}`);
|
||||
Reference in New Issue
Block a user