fix
This commit is contained in:
parent
1736ee3837
commit
e7b171d648
|
@ -290,12 +290,6 @@ async function generateApiClientJSDoc(
|
|||
'',
|
||||
' catch<TResult = never>(onrejected?: ((reason: TError) => TResult | PromiseLike<TResult>) | undefined | null): Promise<TSuccess | TResult>;',
|
||||
'}',
|
||||
'',
|
||||
'class ErrPromise<TSuccess, TError> extends Promise<TSuccess> implements IErrPromise<TSuccess, TError> {',
|
||||
' constructor(executor: (resolve: (value: TSuccess | PromiseLike<TSuccess>) => void, reject: (reason: TError) => void) => void) {',
|
||||
' super(executor);',
|
||||
' }',
|
||||
'}',
|
||||
);
|
||||
endpointOutputLine.push('');
|
||||
|
||||
|
@ -312,7 +306,7 @@ async function generateApiClientJSDoc(
|
|||
' endpoint: E,',
|
||||
' params: P,',
|
||||
' credential?: string | null,',
|
||||
' ): ErrPromise<SwitchCaseResponseType<E, P>, RE>;',
|
||||
' ): IErrPromise<SwitchCaseResponseType<E, P>, RE>;',
|
||||
);
|
||||
|
||||
if (i < endpoints.length - 1) {
|
||||
|
|
|
@ -65,8 +65,8 @@ export class APIClient {
|
|||
endpoint: E,
|
||||
params: P = {} as P,
|
||||
credential?: string | null,
|
||||
): ErrPromise<SwitchCaseResponseType<E, P>, RE> {
|
||||
return new Promise((resolve, reject) => {
|
||||
): IErrPromise<SwitchCaseResponseType<E, P>, RE> {
|
||||
return new ErrPromise((resolve, reject) => {
|
||||
this.fetch(`${this.origin}/api/${endpoint}`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue