исправил ошибки компиляции TypeScript

This commit is contained in:
Халимов Рустам
2026-04-17 00:37:37 +03:00
parent 56f75ae32b
commit c264b7df27

View File

@@ -3,7 +3,7 @@ import type { User } from '../../../core/domain/types';
export class AuthApi {
static async login(username: string, password: string) {
const response = await httpClient.request<{ accessToken: string; userId: string; username: string; displayName: string }>('/auth/login', {
const response = await httpClient.request<any>('/auth/login', {
method: 'POST',
body: JSON.stringify({ username, password }),
});
@@ -16,12 +16,12 @@ export class AuthApi {
username: response.username || (response as any).userName,
displayName: response.displayName,
avatar: response.avatar || null
} as User
} as unknown as User
};
}
static async register(username: string, displayName: string, password: string, bio?: string) {
const response = await httpClient.request<{ accessToken: string; userId: string; username: string; displayName: string }>('/auth/register', {
const response = await httpClient.request<any>('/auth/register', {
method: 'POST',
body: JSON.stringify({ username, displayName, password, bio }),
});
@@ -34,7 +34,7 @@ export class AuthApi {
username: response.username || (response as any).userName,
displayName: response.displayName,
avatar: response.avatar || null
} as User
} as unknown as User
};
}
@@ -47,7 +47,7 @@ export class AuthApi {
username: response.username || response.userName,
displayName: response.displayName,
avatar: response.avatar || response.avatarUrl
} as User,
} as unknown as User,
token: response.accessToken
};
}