डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

Full Stack Web Development with Laravel

Full Stack Web Development with Laravel

Affiliate Program

Affiliate Program

Next JS Controller for CRUD

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;
}
© 2016 - 2023, All Rights are Reserved.