ti2 1.0.98 → 1.0.99
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.
- package/controllers/bookings.js +13 -8
- package/package.json +1 -1
package/controllers/bookings.js
CHANGED
|
@@ -450,14 +450,19 @@ const createBooking = plugins => async (req, res, next) => {
|
|
|
450
450
|
assert(userAppKeys, 'could not find the app key');
|
|
451
451
|
const token = await userAppKeys.token;
|
|
452
452
|
const func = (app.createBooking || app.addServiceToItinerary).bind(app);
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
453
|
+
let results;
|
|
454
|
+
if (payload.mock) {
|
|
455
|
+
results = { mock: true, success: true, bookingId: '1234567890' };
|
|
456
|
+
} else {
|
|
457
|
+
results = await func({
|
|
458
|
+
axios,
|
|
459
|
+
token,
|
|
460
|
+
payload,
|
|
461
|
+
typeDefsAndQueries,
|
|
462
|
+
requestId: req.requestId,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
console.log(`emitting bookingsCreateBooking event for ${appKey}, user ${userId}, hint ${hint}, results: ${JSON.stringify(results)}`);
|
|
461
466
|
app.events.emit('bookingsCreateBooking', {
|
|
462
467
|
userId,
|
|
463
468
|
hint,
|