From ea6c061349341f18ce650efe0e400a7db3aae002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bonnet?= Date: Fri, 2 Dec 2022 17:34:14 +0100 Subject: [PATCH] fix(jobs): types and get job service --- libs/shared/enums/src/lib/utils/get-service-type.ts | 7 +++---- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/libs/shared/enums/src/lib/utils/get-service-type.ts b/libs/shared/enums/src/lib/utils/get-service-type.ts index 97dab93b16..de2e8d8cb9 100644 --- a/libs/shared/enums/src/lib/utils/get-service-type.ts +++ b/libs/shared/enums/src/lib/utils/get-service-type.ts @@ -1,4 +1,3 @@ -import { JobScheduleEvent } from 'qovery-typescript-axios' import { ApplicationEntity, ContainerApplicationEntity, @@ -11,15 +10,15 @@ import { ServiceTypeEnum } from '../service-type.enum' export const getServiceType = (data: ApplicationEntity | DatabaseEntity) => { let currentType: ServiceTypeEnum - const isJob = (data as JobApplicationEntity).max_nb_restart + const isJob = (data as JobApplicationEntity).max_nb_restart !== undefined if ((data as ContainerApplicationEntity).image_name) { currentType = ServiceTypeEnum.CONTAINER } else if (!(data as GitApplicationEntity).build_mode && !(data as ContainerApplicationEntity).image_name && !isJob) { currentType = ServiceTypeEnum.DATABASE - } else if (isJob && (data as JobApplicationEntity).schedule?.event !== JobScheduleEvent.CRON) { + } else if (isJob && (data as JobApplicationEntity).schedule?.cronjob) { currentType = ServiceTypeEnum.CRON_JOB - } else if (isJob && (data as JobApplicationEntity).schedule?.event === JobScheduleEvent.CRON) { + } else if (isJob && !(data as JobApplicationEntity).schedule?.cronjob) { currentType = ServiceTypeEnum.LIFECYCLE_JOB } else { currentType = ServiceTypeEnum.APPLICATION diff --git a/package.json b/package.json index bd686d6fe0..325a3721af 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "msw": "^0.42.1", "postcss": "8.4.16", "posthog-js": "^1.24.0", - "qovery-typescript-axios": "^1.1.47", + "qovery-typescript-axios": "^1.1.53", "react": "18.2.0", "react-beautiful-dnd": "^13.1.0", "react-dom": "18.2.0", diff --git a/yarn.lock b/yarn.lock index ac4c89182e..d810a12c74 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16535,10 +16535,10 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qovery-typescript-axios@^1.1.47: - version "1.1.47" - resolved "https://registry.yarnpkg.com/qovery-typescript-axios/-/qovery-typescript-axios-1.1.47.tgz#bf490180bc946ea52b1b9a3a55b3b11cf4393462" - integrity sha512-CXL3vlJe5rcJvhtLWSQqqkShlLKQquI5BFfqhPPsKS8ircajTbGWOZlovWO8k9Ej5o06mDGsw9YKK4ACTaiArg== +qovery-typescript-axios@^1.1.53: + version "1.1.53" + resolved "https://registry.yarnpkg.com/qovery-typescript-axios/-/qovery-typescript-axios-1.1.53.tgz#01946045441fa54ae35abce5fee9dd3ec0a96be7" + integrity sha512-mKX0HRFwt/7bLN5rlnwUKvNdPhz7J5ylY5bQc7ZvmP4gvV9pJNrOsAhGLEOxihXeEwAFpSHN4mTJsqdneBO+zg== dependencies: axios "^0.21.4"