Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Format price before it’s sent
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Apr 10, 2019
1 parent 4e0b32e commit d9f551f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@
});
},
create() {
apiRequest.send('post', '/shipping/' + this.method.id + '/prices', this.current)
let payload = JSON.parse(JSON.stringify(this.current));
payload.rate = payload.rate * 100;
payload.min_basket = payload.min_basket * 100;
apiRequest.send('post', '/shipping/' + this.method.id + '/prices', payload)
.then(response => {
CandyEvent.$emit('notification', {
level: 'success'
Expand All @@ -131,7 +134,10 @@
});
},
update() {
apiRequest.send('put', 'shipping/prices/' + this.current.id, this.current).then(response => {
let payload = JSON.parse(JSON.stringify(this.current));
payload.rate = payload.rate * 100;
payload.min_basket = payload.min_basket * 100;
apiRequest.send('put', 'shipping/prices/' + this.current.id, payload).then(response => {
CandyEvent.$emit('shipping-prices-updated');
});
}
Expand Down

0 comments on commit d9f551f

Please sign in to comment.