* fix: emits use ev instead of e

* fix: errors use err instead of e

* fix: replace use of data where possible

* fix: events use evt instead of e

* fix: use strict equals

* fix: use emoji instead of e

* fix: vue lints
This commit is contained in:
Johann150
2022-05-26 15:53:09 +02:00
committed by GitHub
parent 9c80403072
commit 3dae18b93c
69 changed files with 255 additions and 257 deletions

View File

@@ -59,10 +59,10 @@ export const apiWithDialog = ((
token?: string | null | undefined,
) => {
const promise = api(endpoint, data, token);
promiseDialog(promise, null, (e) => {
promiseDialog(promise, null, (err) => {
alert({
type: 'error',
text: e.message + '\n' + (e as any).id,
text: err.message + '\n' + (err as any).id,
});
});
@@ -72,7 +72,7 @@ export const apiWithDialog = ((
export function promiseDialog<T extends Promise<any>>(
promise: T,
onSuccess?: ((res: any) => void) | null,
onFailure?: ((e: Error) => void) | null,
onFailure?: ((err: Error) => void) | null,
text?: string,
): T {
const showing = ref(true);
@@ -88,14 +88,14 @@ export function promiseDialog<T extends Promise<any>>(
showing.value = false;
}, 1000);
}
}).catch(e => {
}).catch(err => {
showing.value = false;
if (onFailure) {
onFailure(e);
onFailure(err);
} else {
alert({
type: 'error',
text: e
text: err,
});
}
});