jeudi 3 janvier 2019

How to add more keys to request payload on click of a button?

I have a custom request payload to get api response in an ember-bootstrap-modal. Now I want to add another toggle button "show/hide" which should add/remove keys to my request payload object on click of it. How can I do that?

X.js :

let reqPayload = {
    retrieveFlags: {
        childFare: true,
        additionalGuestFare: true,
        roundUpFare: true,
        averageFare: true
        }
      }

y.hbs:

<button>Show</button>

on click retrieveFlags should be

let reqPayload = {
    retrieveFlags: {
        childFare: true,
        additionalGuestFare: true,
        roundUpFare: true,
        averageFare: true,
        refundableFare: true,
        nonRefundableDepositFare: true,
        nonRefundableFare: true,
        }
      }




Aucun commentaire:

Enregistrer un commentaire