-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathoperation.ts
55 lines (51 loc) · 1.37 KB
/
operation.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type {
OperationCancelRequestParams,
OperationForgetRequestParams,
OperationListRequestParams,
TOperationList,
} from '../../types/api/operations';
import type {AxiosOptions} from './base';
import {BaseYdbAPI} from './base';
export class OperationAPI extends BaseYdbAPI {
getOperationList(
params: OperationListRequestParams,
{concurrentId, signal}: AxiosOptions = {},
) {
return this.get<TOperationList>(
this.getPath('/operation/list'),
{...params},
{
concurrentId,
requestConfig: {signal},
},
);
}
cancelOperation(
params: OperationCancelRequestParams,
{concurrentId, signal}: AxiosOptions = {},
) {
return this.post<TOperationList>(
this.getPath('/operation/cancel'),
{},
{...params},
{
concurrentId,
requestConfig: {signal},
},
);
}
forgetOperation(
params: OperationForgetRequestParams,
{concurrentId, signal}: AxiosOptions = {},
) {
return this.post<TOperationList>(
this.getPath('/operation/forget'),
{},
{...params},
{
concurrentId,
requestConfig: {signal},
},
);
}
}