Skip to content

Commit b45128a

Browse files
committed
fix: deprecate failed import api response type
1 parent 9027a11 commit b45128a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/typings/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export type { System, User, Session, UserStatus, DealStatus, PaymentStatus, PaymentType, DealCurrency } from './entities'
22
export type { Options, HttpMethod, GetCourseAction, RequestInit } from './lib'
3-
export type { JSONValue, RequireAtLeastOne, ExportApiResponse, ImportApiResponse, ImportApiErrorResponse, ImportApiSuccessResponse } from './utility'
3+
export type { JSONValue, RequireAtLeastOne, ExportApiResponse, ImportApiResponse } from './utility'

src/typings/utility.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ export type RequireAtLeastOne<T> = {
1010
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>
1111
}[keyof T]
1212

13-
export type ImportApiResponse<T> = ImportApiSuccessResponse<T> | ImportApiErrorResponse
14-
15-
export type ImportApiSuccessResponse<T> = {
13+
export type ImportApiResponse<T> = {
1614
success: true
1715
action: string
1816
result: T
19-
}
20-
21-
export type ImportApiErrorResponse = {
22-
success: false
23-
error: string
17+
/**
18+
* Сообщение об ошибке
19+
* @example Неавторизованное API-обращение
20+
*/
21+
error?: string
2422
}
2523

2624
export type ExportApiResponse<T> = {

0 commit comments

Comments
 (0)