From 03c8e4ad1d223d3f6f52930445d6479db5555930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Zakrzewski?= Date: Fri, 22 Nov 2024 13:48:14 +0100 Subject: [PATCH] WIP fix broken editing of the case --- data-serving/data-service/src/controllers/case.ts | 1 + .../scripts/setup-db/schemas/day0cases.indexes.json | 10 ++++++++++ .../scripts/setup-db/schemas/day0cases.schema.json | 3 +++ 3 files changed, 14 insertions(+) diff --git a/data-serving/data-service/src/controllers/case.ts b/data-serving/data-service/src/controllers/case.ts index be8c5095d..69b58ed94 100644 --- a/data-serving/data-service/src/controllers/case.ts +++ b/data-serving/data-service/src/controllers/case.ts @@ -80,6 +80,7 @@ const caseFromDTO = async (receivedCase: CaseDTO) => { }; } } + aCase.bundleId = new ObjectId(aCase.bundleId) return aCase; }; diff --git a/data-serving/scripts/setup-db/schemas/day0cases.indexes.json b/data-serving/scripts/setup-db/schemas/day0cases.indexes.json index b55dd708a..dc4a62d71 100644 --- a/data-serving/scripts/setup-db/schemas/day0cases.indexes.json +++ b/data-serving/scripts/setup-db/schemas/day0cases.indexes.json @@ -46,6 +46,16 @@ } } }, + { + "name": "bundleIdIdx", + "key": { + "bundleId": -1 + }, + "collation": { + "locale": "en_US", + "strength": 2 + } + }, { "name": "demographicsGenderIdx", "key": { diff --git a/data-serving/scripts/setup-db/schemas/day0cases.schema.json b/data-serving/scripts/setup-db/schemas/day0cases.schema.json index 4175de3de..25cdeb29d 100644 --- a/data-serving/scripts/setup-db/schemas/day0cases.schema.json +++ b/data-serving/scripts/setup-db/schemas/day0cases.schema.json @@ -11,6 +11,9 @@ "__v": { "bsonType": "int" }, + "bundleId": { + "bsonType": "objectId" + }, "list": { "bsonType": "bool" },