import { IUser , IUserWithGroups } from "@staticdeploy/core" ; import { AxiosInstance } from "axios" ; export default class UsersClient { constructor ( private axios ) { } async getAll ( ) { const result = await this . axios . get ( "/users" ) ; return result . data ; } async getOne ( id ) { const result = await this . axios . get ( `/users/${ id }` ) ; return result . data ; } async getCurrentUser ( ) { const result = await this . axios . get ( "/currentUser" ) ; return result . data ; } async create ( user ) { const result = await this . axios . post ( "/users" , user ) ; return result . data ; } async update ( id , patch ) { const result = await this . axios . patch ( `/users/${ id }` , patch ) ; return result . data ; } async delete ( id ) { await this . axios . delete ( `/users/${ id }` ) ; } }