import axiosInstance from "../http/axiosInstance";
import { UserCreds, UserData } from "../interfaces/auth";

export default class UserService {
    static async createUser(data: any) {
        return await axiosInstance.post(`/auth/user`, data)
    }

    static async getCurrentUser(token: string) {
        return await axiosInstance.get(`/auth/get_current_user/${token}`)
    }

    static async getUsers() {
        return await axiosInstance.get(`/auth/user`)
    }

    // static async deleteUser(id: number) {
    //     return await axiosInstance.delete(`/auth/user/${id}`)
    // }

    static async getUser(id: number) {
        return await axiosInstance.get(`/auth/user/${id}`)
    }

    static async updatePassword(data: UserCreds) {
        return await axiosInstance.put(`/auth/user/password_change`, data)
    }

    static async updateUser(data: UserData) {
        return await axiosInstance.put(`/auth/user`, data)
    }
}