From 72c724c1e7fb69a3eced82e36ccda26c3dad5331 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 17 Nov 2021 09:59:34 +0100 Subject: [PATCH] refactor(ticket): loadDefaultTicketAction() --- modules/ticket/front/basic-data/step-two/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ticket/front/basic-data/step-two/index.js b/modules/ticket/front/basic-data/step-two/index.js index bb6e6958f..7ffdb8315 100644 --- a/modules/ticket/front/basic-data/step-two/index.js +++ b/modules/ticket/front/basic-data/step-two/index.js @@ -23,9 +23,9 @@ class Controller extends Component { } loadDefaultTicketAction() { - let filter = {where: {code: 'changePrice'}}; - if (this.aclService.hasAny(['salesAssistant'])) - filter = {where: {code: 'turnInMana'}}; + const isSalesAssistant = this.aclService.hasAny(['salesAssistant']); + const defaultOption = isSalesAssistant ? 'turnInMana' : 'changePrice'; + const filter = {where: {code: defaultOption}}; this.$http.get(`TicketUpdateActions`, {filter}).then(response => { return this.ticket.option = response.data[0].id;