Skip to content

Commit

Permalink
rework: Remove global checks
Browse files Browse the repository at this point in the history
  • Loading branch information
d-beezee committed Aug 9, 2024
1 parent b6c2e80 commit 18f150f
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/routes/campaigns/campaignId/ux/_patch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ export default class PatchUx extends UserRoute<{
}

protected async prepare(): Promise<void> {
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 {
Expand All @@ -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() {
Expand Down

0 comments on commit 18f150f

Please sign in to comment.