import axios from "axios";
export async function getUsers(){
const {data} = await axios.get("http://localhost:3000/api/users");
return data.users;
}
export async function deleteUser(user_id){
const {data} = await axios.delete("http://localhost:3000/api/users",{
data:user_id
});
return data;
}
export async function editUser(newRecord){
const {data}= await axios.put("http://localhost:3000/api/users",newRecord);
return data;
}
export async function addUser(newRecord){
const {data}= await axios.post("http://localhost:3000/api/users",newRecord);
return data;
}
export async function getSingleUserById(id){
const {data}= await axios.get(`http://localhost:3000/api/users/${id}`);
return data;
}