feat: initial admin panel
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { apiClient } from './client';
|
||||
import { LoginCredentials, LoginResponse } from '@/types/auth';
|
||||
|
||||
export const authApi = {
|
||||
login: async (credentials: LoginCredentials): Promise<LoginResponse> => {
|
||||
const formData = new FormData();
|
||||
formData.append('auth', credentials.auth);
|
||||
formData.append('password', credentials.password);
|
||||
formData.append('package_name', credentials.package_name);
|
||||
|
||||
return apiClient.post<LoginResponse>('/auth/login', formData);
|
||||
},
|
||||
|
||||
logout: async (token: string): Promise<void> => {
|
||||
return apiClient.post('/auth/logout', {}, token);
|
||||
},
|
||||
|
||||
getProfile: async (token: string): Promise<any> => {
|
||||
return apiClient.get('/auth/profile', token);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user