import { Users } from "../@types"; import Service from "../Service"; class UserService extends Service{ static getAllUsers(){ return this.Http .get('/users') .then(this.getData) } static getDetailedUser (userId: number){ return this.Http .get(`/users/${userId}`) .then(this.getData) } static updateExistingUser( userId: number, userData: Users.UserInput ) { return this.Http.put( `/users/${userId}`, userData ).then(this.getData); } static insertNewUser(userData: Users.UserInput) { return this.Http.post( '/users', userData ).then(this.getData); } static activateExistingUser(userId: number) { return this.Http.put<{}>( `/users/${userId}/activation` ).then(this.getData); } static deactivateExistingUser(userId: number) { return this.Http.delete<{}>( `/users/${userId}/activation` ).then(this.getData); } } export default UserService;