Reports test
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import axiosInstance from "../http/axiosInstance";
|
||||
import axiosInstance, { axiosInstanceAuth } from "../http/axiosInstance";
|
||||
|
||||
export default class AuthService {
|
||||
static async login(data: any) {
|
||||
return await axiosInstance.post(`/auth/login`, data, {
|
||||
return await axiosInstanceAuth.post(`/auth/login`, data, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
@ -10,10 +10,10 @@ export default class AuthService {
|
||||
}
|
||||
|
||||
static async refreshToken(token: string) {
|
||||
return await axiosInstance.post(`/auth/refresh_token/${token}`)
|
||||
return await axiosInstanceAuth.post(`/auth/refresh_token/${token}`)
|
||||
}
|
||||
|
||||
static async getCurrentUser(token: string) {
|
||||
return await axiosInstance.get(`/auth/get_current_user/${token}`)
|
||||
return await axiosInstanceAuth.get(`/auth/get_current_user/${token}`)
|
||||
}
|
||||
}
|
@ -1,18 +1,18 @@
|
||||
import axiosInstance from "../http/axiosInstance";
|
||||
import axiosInstance, { axiosInstanceAuth } from "../http/axiosInstance";
|
||||
import { IRoleCreate } from "../interfaces/role";
|
||||
|
||||
export default class RoleService {
|
||||
static async getRoles() {
|
||||
return await axiosInstance.get(`/auth/roles`)
|
||||
return await axiosInstanceAuth.get(`/auth/roles`)
|
||||
}
|
||||
|
||||
static async createRole(data: IRoleCreate) {
|
||||
return await axiosInstance.post(`/auth/roles/`, data)
|
||||
return await axiosInstanceAuth.post(`/auth/roles/`, data)
|
||||
}
|
||||
|
||||
|
||||
static async getRoleById(id: number) {
|
||||
return await axiosInstance.get(`/auth/roles/${id}`)
|
||||
return await axiosInstanceAuth.get(`/auth/roles/${id}`)
|
||||
}
|
||||
|
||||
// static async deleteRole(id: number) {
|
||||
|
@ -1,17 +1,17 @@
|
||||
import axiosInstance from "../http/axiosInstance";
|
||||
import axiosInstance, { axiosInstanceAuth } 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)
|
||||
return await axiosInstanceAuth.post(`/auth/user`, data)
|
||||
}
|
||||
|
||||
static async getCurrentUser(token: string) {
|
||||
return await axiosInstance.get(`/auth/get_current_user/${token}`)
|
||||
return await axiosInstanceAuth.get(`/auth/get_current_user/${token}`)
|
||||
}
|
||||
|
||||
static async getUsers() {
|
||||
return await axiosInstance.get(`/auth/user`)
|
||||
return await axiosInstanceAuth.get(`/auth/user`)
|
||||
}
|
||||
|
||||
// static async deleteUser(id: number) {
|
||||
@ -19,14 +19,14 @@ export default class UserService {
|
||||
// }
|
||||
|
||||
static async getUser(id: number) {
|
||||
return await axiosInstance.get(`/auth/user/${id}`)
|
||||
return await axiosInstanceAuth.get(`/auth/user/${id}`)
|
||||
}
|
||||
|
||||
static async updatePassword(data: UserCreds) {
|
||||
return await axiosInstance.put(`/auth/user/password_change`, data)
|
||||
return await axiosInstanceAuth.put(`/auth/user/password_change`, data)
|
||||
}
|
||||
|
||||
static async updateUser(data: UserData) {
|
||||
return await axiosInstance.put(`/auth/user`, data)
|
||||
return await axiosInstanceAuth.put(`/auth/user`, data)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user