From 3e2717986d9cfa9ea7e79f3094a4bc30c46aa2a6 Mon Sep 17 00:00:00 2001 From: akumar Date: Fri, 15 Mar 2024 12:17:05 +0100 Subject: [PATCH] fix: add resource id if its missing and enahnce logger --- cfg/config.json | 2 +- cfg/config_production.json | 2 +- src/schedulingService.ts | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cfg/config.json b/cfg/config.json index 1cfb351..c452249 100644 --- a/cfg/config.json +++ b/cfg/config.json @@ -14,7 +14,7 @@ "logger": { "console": { "handleExceptions": false, - "level": "error", + "level": "silly", "colorize": true, "prettyPrint": true }, diff --git a/cfg/config_production.json b/cfg/config_production.json index 0ccc047..321aa3d 100644 --- a/cfg/config_production.json +++ b/cfg/config_production.json @@ -1,7 +1,7 @@ { "logger": { "elasticsearch": { - "level": "error", + "level": "info", "clientOpts": { "node": "http://elasticsearch:9200" }, diff --git a/src/schedulingService.ts b/src/schedulingService.ts index 33162ba..c3b404d 100644 --- a/src/schedulingService.ts +++ b/src/schedulingService.ts @@ -1453,6 +1453,9 @@ export class SchedulingService implements SchedulingServiceServiceImplementation } } else if ((action === AuthZAction.CREATE || !resource.id) && !resource.data.meta.owners) { let ownerAttributes = _.cloneDeep(orgOwnerAttributes); + if (!resource.id) { + resource.id = uuid.v4().replace(/-/g, ''); + } // add user as default owners if (resource.id) { ownerAttributes.push(