From c47b4f6d6b217a102861e38e35608088b418943a Mon Sep 17 00:00:00 2001 From: Nikhil Shahi Date: Tue, 29 Nov 2022 13:38:26 -0600 Subject: [PATCH] fix metlo config schema and get metlo config (#152) --- backend/src/api/metlo-config/index.ts | 7 +++++-- backend/src/services/metlo-config/constants.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/api/metlo-config/index.ts b/backend/src/api/metlo-config/index.ts index 435b1daf..2b1a7dc7 100644 --- a/backend/src/api/metlo-config/index.ts +++ b/backend/src/api/metlo-config/index.ts @@ -23,9 +23,12 @@ export const getMetloConfigHandler = async ( res: Response, ): Promise => { try { - const metloConfig = await getMetloConfig(req.ctx) + let metloConfig = await getMetloConfig(req.ctx) if (!metloConfig) { - throw new Error404NotFound("No config saved yet.") + metloConfig = { + uuid: "", + configString: "", + } } await ApiResponseHandler.success(res, metloConfig) } catch (err) { diff --git a/backend/src/services/metlo-config/constants.ts b/backend/src/services/metlo-config/constants.ts index 8b96db12..f0306537 100644 --- a/backend/src/services/metlo-config/constants.ts +++ b/backend/src/services/metlo-config/constants.ts @@ -108,8 +108,8 @@ export const METLO_CONFIG_SCHEMA = { }, }, }, - additionalProperties: false, }, + additionalProperties: false, definitions: { disable_paths_object: { type: "object",