1
0
Fork 0
mirror of synced 2024-08-15 10:01:34 +12:00
This commit is contained in:
Martin McKeaveney 2023-07-20 16:56:31 +01:00
parent 6b6fba9393
commit b5340c20d8
2 changed files with 9 additions and 3 deletions

View file

@ -3,7 +3,7 @@ import { doWithDB, DocumentType } from "../db"
import { Database, App } from "@budibase/types" import { Database, App } from "@budibase/types"
export enum AppState { export enum AppState {
INVALID = "invalid" INVALID = "invalid",
} }
const EXPIRY_SECONDS = 3600 const EXPIRY_SECONDS = 3600

View file

@ -101,7 +101,9 @@ export async function getAllApps({
const response = await Promise.allSettled(appPromises) const response = await Promise.allSettled(appPromises)
const apps = response const apps = response
.filter( .filter(
(result: any) => result.status === "fulfilled" && result.value?.state !== AppState.INVALID (result: any) =>
result.status === "fulfilled" &&
result.value?.state !== AppState.INVALID
) )
.map(({ value }: any) => value) .map(({ value }: any) => value)
if (!all) { if (!all) {
@ -126,7 +128,11 @@ export async function getAppsByIDs(appIds: string[]) {
) )
// have to list the apps which exist, some may have been deleted // have to list the apps which exist, some may have been deleted
return settled return settled
.filter(promise => promise.status === "fulfilled" && promise.value?.state !== AppState.INVALID) .filter(
promise =>
promise.status === "fulfilled" &&
promise.value?.state !== AppState.INVALID
)
.map(promise => (promise as PromiseFulfilledResult<App>).value) .map(promise => (promise as PromiseFulfilledResult<App>).value)
} }