iticket-seatingplan-dev 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,21 +67,58 @@ const SeatingPlan = _ref => {
67
67
  'content-type': 'application/json',
68
68
  'basket-key': sessionId
69
69
  }
70
- }).then(response => response.json()).then(response => {
71
- s.s = 4;
72
- s.bookedPrice = price;
73
- chosenSeat.circle.target.setStyle({
74
- fillColor: statusColors.booked
75
- });
76
- setProcessing(false);
77
- setBookedSeats([...bookedSeats, {
78
- ssId: s.ssId,
79
- r: s.r,
80
- c: s.c,
81
- showingId: showingId,
82
- p: price || s.defaultPrice,
83
- paName: s.priceAgeName
84
- }]);
70
+ }).then(response => {
71
+ console.log(response);
72
+ if ((response === null || response === void 0 ? void 0 : response.status) === 403) {
73
+ chosenSeat.circle.target.setStyle({
74
+ fillColor: statusColors.sold
75
+ });
76
+ chosenSeat.seat.s = 2;
77
+ const event = {
78
+ type: 'error',
79
+ details: {
80
+ error: {
81
+ code: 403,
82
+ message: "The seat you're trying to book is no longer available."
83
+ }
84
+ }
85
+ };
86
+ callbackFunction(event);
87
+ setProcessing(false);
88
+ } else if ((response === null || response === void 0 ? void 0 : response.status) === 429) {
89
+ chosenSeat.circle.target.setStyle({
90
+ fillColor: statusColors.available
91
+ });
92
+ const event = {
93
+ type: 'error',
94
+ details: {
95
+ error: {
96
+ code: 429,
97
+ message: "Someone else selected this first. Please try again"
98
+ }
99
+ }
100
+ };
101
+ callbackFunction(event);
102
+ setProcessing(false);
103
+ } else {
104
+ {
105
+ console.log('rrrrrrrrr', response);
106
+ s.s = 4;
107
+ s.bookedPrice = price;
108
+ chosenSeat.circle.target.setStyle({
109
+ fillColor: statusColors.booked
110
+ });
111
+ setProcessing(false);
112
+ setBookedSeats([...bookedSeats, {
113
+ ssId: s.ssId,
114
+ r: s.r,
115
+ c: s.c,
116
+ showingId: showingId,
117
+ p: price || s.defaultPrice,
118
+ paName: s.priceAgeName
119
+ }]);
120
+ }
121
+ }
85
122
  }).catch(error => {
86
123
  chosenSeat.circle.target.setStyle({
87
124
  fillColor: statusColors.available
@@ -111,7 +148,7 @@ const SeatingPlan = _ref => {
111
148
  headers: {
112
149
  'basket-key': sessionId
113
150
  }
114
- }).then(response => response.json()).then(response => {
151
+ }).then(response => {
115
152
  s.s = 1;
116
153
  s.bookedPrice = null;
117
154
  e.target.setStyle({
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "iticket-seatingplan-dev",
3
3
  "description": "Seating plan with FLEXi pricing",
4
4
  "author": "gedwyne",
5
- "version": "1.0.30",
5
+ "version": "1.0.32",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "iticket",