From 075bd28eeb2487c028c590a7ce31cf2099d7a59b Mon Sep 17 00:00:00 2001 From: Daniel Strano Date: Thu, 11 Jan 2024 16:01:17 -0500 Subject: [PATCH] Fix platform properties UI --- metriq-api/service/propertyService.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/metriq-api/service/propertyService.js b/metriq-api/service/propertyService.js index 0a2b7b3..a854c53 100644 --- a/metriq-api/service/propertyService.js +++ b/metriq-api/service/propertyService.js @@ -4,6 +4,8 @@ // It doesn't exactly fit the model-service-controller abstraction paradigm that we use, but maybe we can build a "domain" interface at this level. // Data Access Layer +const DataTypeService = require('./dataTypeService') +const dataTypeService = new DataTypeService() const PlatformDataTypeService = require('./platformDataTypeService') const platformDataTypeService = new PlatformDataTypeService() const PlatformDataTypeValueService = require('./platformDataTypeValueService') @@ -57,6 +59,7 @@ class PropertyService { } property.id = platformDataTypeValue.id + property.typeFriendlyName = (await dataTypeService.getByPk(property.dataTypeId)).friendlyName return { success: true, body: property } } @@ -105,9 +108,8 @@ class PropertyService { } const platformId = property.platformId await property.destroy() - const platform = await platformService.getSanitized(platformId, userId) - return { success: true, body: platform } + return await platformService.getSanitized(platformId, userId) } }