feat(client): regenerate openapi types

This commit is contained in:
2025-06-16 12:56:30 +05:00
parent ee92428ec3
commit 92203351ff
4 changed files with 16 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
import axios from 'axios';
import { Access, Auth } from '../types/auth';
import { Auth, Tokens } from '../types/auth';
import { User } from '../types/user';
import { AuthService } from '../services/authService';
import axiosRetry from 'axios-retry';
@@ -70,23 +70,16 @@ base.interceptors.response.use(
}
);
interface newAccess {
accessToken: string;
refreshToken: string;
}
const api = {
// auth
// async login(auth: Auth): Promise<Access> {
async login(auth: Auth): Promise<newAccess> {
// const response = (await base.post) <Access> ('/auth', auth);
const response = await base.post<newAccess>('/auth', auth);
async login(auth: Auth): Promise<Tokens> {
const response = await base.post<Tokens>('/auth', auth);
return response.data;
},
async refreshToken(): Promise<Access> {
async refreshToken(): Promise<Tokens> {
const token = localStorage.getItem('refreshToken');
const response = await base.post<Access>(
const response = await base.post<Tokens>(
'/auth/refresh',
{},
{