diff --git a/k8s/analytics/values-prod.yaml b/k8s/analytics/values-prod.yaml index 6f4d7cfebb..c35645a488 100644 --- a/k8s/analytics/values-prod.yaml +++ b/k8s/analytics/values-prod.yaml @@ -8,7 +8,7 @@ images: celeryWorker: eu.gcr.io/airqo-250220/airqo-analytics-celery-worker reportJob: eu.gcr.io/airqo-250220/airqo-analytics-report-job devicesSummaryJob: eu.gcr.io/airqo-250220/airqo-analytics-devices-summary-job - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 api: name: airqo-analytics-api label: analytics-api diff --git a/k8s/auth-service/values-prod.yaml b/k8s/auth-service/values-prod.yaml index cba217b6c5..2789470f1a 100644 --- a/k8s/auth-service/values-prod.yaml +++ b/k8s/auth-service/values-prod.yaml @@ -6,7 +6,7 @@ app: replicaCount: 3 image: repository: eu.gcr.io/airqo-250220/airqo-auth-api - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' podAnnotations: {} diff --git a/k8s/auth-service/values-stage.yaml b/k8s/auth-service/values-stage.yaml index 32f9f2d950..5c6329935c 100644 --- a/k8s/auth-service/values-stage.yaml +++ b/k8s/auth-service/values-stage.yaml @@ -6,7 +6,7 @@ app: replicaCount: 2 image: repository: eu.gcr.io/airqo-250220/airqo-stage-auth-api - tag: stage-c701f88b-1734080836 + tag: stage-9267ecdf-1734100799 nameOverride: '' fullnameOverride: '' podAnnotations: {} diff --git a/k8s/exceedance/values-prod-airqo.yaml b/k8s/exceedance/values-prod-airqo.yaml index 8d7efe12cf..f79ab54d1e 100644 --- a/k8s/exceedance/values-prod-airqo.yaml +++ b/k8s/exceedance/values-prod-airqo.yaml @@ -4,6 +4,6 @@ app: configmap: env-exceedance-production image: repository: eu.gcr.io/airqo-250220/airqo-exceedance-job - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' diff --git a/k8s/exceedance/values-prod-kcca.yaml b/k8s/exceedance/values-prod-kcca.yaml index c569cacf14..ca6f623d9b 100644 --- a/k8s/exceedance/values-prod-kcca.yaml +++ b/k8s/exceedance/values-prod-kcca.yaml @@ -4,6 +4,6 @@ app: configmap: env-exceedance-production image: repository: eu.gcr.io/airqo-250220/kcca-exceedance-job - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' diff --git a/k8s/predict/values-prod.yaml b/k8s/predict/values-prod.yaml index 444d824252..7cfdf4aa02 100644 --- a/k8s/predict/values-prod.yaml +++ b/k8s/predict/values-prod.yaml @@ -7,7 +7,7 @@ images: predictJob: eu.gcr.io/airqo-250220/airqo-predict-job trainJob: eu.gcr.io/airqo-250220/airqo-train-job predictPlaces: eu.gcr.io/airqo-250220/airqo-predict-places-air-quality - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 api: name: airqo-prediction-api label: prediction-api diff --git a/k8s/spatial/values-prod.yaml b/k8s/spatial/values-prod.yaml index 03977e24cb..670474b0b0 100644 --- a/k8s/spatial/values-prod.yaml +++ b/k8s/spatial/values-prod.yaml @@ -6,7 +6,7 @@ app: replicaCount: 3 image: repository: eu.gcr.io/airqo-250220/airqo-spatial-api - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' podAnnotations: {} diff --git a/k8s/website/values-prod.yaml b/k8s/website/values-prod.yaml index 0f78abe6f2..5ea1677fed 100644 --- a/k8s/website/values-prod.yaml +++ b/k8s/website/values-prod.yaml @@ -6,7 +6,7 @@ app: replicaCount: 3 image: repository: eu.gcr.io/airqo-250220/airqo-website-api - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' podAnnotations: {} diff --git a/src/auth-service/utils/create-preference.js b/src/auth-service/utils/create-preference.js index 35d4fb1578..a7ba134320 100644 --- a/src/auth-service/utils/create-preference.js +++ b/src/auth-service/utils/create-preference.js @@ -76,11 +76,7 @@ const prepareUpdate = (body, fieldsToUpdate, fieldsToAddToSet) => { : [update[field]]; // Remove duplicates for specific fields - const uniqueArray = - field === "selected_sites" - ? removeDuplicates(processedArray) - : processedArray; - + const uniqueArray = removeDuplicates(processedArray); update["$set"] = update["$set"] || {}; update["$set"][field] = uniqueArray; delete update[field]; @@ -97,10 +93,7 @@ const prepareUpdate = (body, fieldsToUpdate, fieldsToAddToSet) => { })); // Remove duplicates for specific fields - const uniqueArray = - field === "selected_sites" - ? removeDuplicates(processedArray) - : processedArray; + const uniqueArray = removeDuplicates(processedArray); update["$set"] = update["$set"] || {}; update["$set"][field] = uniqueArray; @@ -393,6 +386,7 @@ const preferences = { } const update = prepareUpdate(body, fieldsToUpdate, fieldsToAddToSet); + const options = { upsert: true, new: true }; const modifyResponse = await PreferenceModel(tenant).findOneAndUpdate(