From 18f150fd0718ded15e8c177eccefdbe7f48cf02d Mon Sep 17 00:00:00 2001 From: Davide Bizzi Date: Fri, 9 Aug 2024 18:15:10 +0200 Subject: [PATCH] rework: Remove global checks --- .../campaigns/campaignId/ux/_patch/index.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/routes/campaigns/campaignId/ux/_patch/index.ts b/src/routes/campaigns/campaignId/ux/_patch/index.ts index f9b51f59..552c2d80 100644 --- a/src/routes/campaigns/campaignId/ux/_patch/index.ts +++ b/src/routes/campaigns/campaignId/ux/_patch/index.ts @@ -72,23 +72,6 @@ export default class PatchUx extends UserRoute<{ } protected async prepare(): Promise { - const body = this.getBody(); - if ( - body && - (body.goal || - body.usersNumber || - body.methodology || - body.sentiments || - body.questions || - typeof body.visible !== "undefined") - ) { - await this.update(); - } - - return this.setSuccess(200, {}); - } - - private async update() { if (!this.data?.data) { await this.insertNewUxData(); } else { @@ -98,6 +81,7 @@ export default class PatchUx extends UserRoute<{ await this.updateQuestions(); await this.updateSentiments(); await this.updateVisibleStatus(); + return this.setSuccess(200, {}); } private async insertNewUxData() {