feat(client): regenerate openapi types
This commit is contained in:
@@ -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',
|
||||
{},
|
||||
{
|
||||
|
Reference in New Issue
Block a user