chore: create AuthApiService

This commit is contained in:
ValdiANS
2025-11-25 09:19:58 +07:00
parent 47690f82ac
commit 1a1fefc237
+23
View File
@@ -0,0 +1,23 @@
import axios from 'axios';
import { httpClient } from '@/services/http/client';
import { BaseApiResponse, LogoutResponse } from '@/types/api/api-general';
export class AuthApiService {
async logout() {
try {
const logoutRes = await httpClient<LogoutResponse>(`/sso/logout`, {
method: 'POST',
});
return logoutRes;
} catch (error) {
if (axios.isAxiosError<BaseApiResponse>(error)) {
return error.response?.data;
}
return undefined;
}
}
}
export const AuthApi = new AuthApiService();