diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-08 07:22:46 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-08 07:22:46 +0100 |
| commit | 2871b154a0bf49eb18d460bf62488fe969252dd6 (patch) | |
| tree | 4907009088688bc34a3ce9710a7ede87dff8997c /api/createPaypalOrder.js | |
| parent | d90bd2b84a7693e3b46e680a7316c6f229efc84c (diff) | |
Doesn't try-catch twice
Diffstat (limited to 'api/createPaypalOrder.js')
| -rw-r--r-- | api/createPaypalOrder.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/api/createPaypalOrder.js b/api/createPaypalOrder.js index f4814e0..d477371 100644 --- a/api/createPaypalOrder.js +++ b/api/createPaypalOrder.js @@ -64,14 +64,9 @@ function handler(request, response) { return [4 /*yield*/, (0, _paypal_1.paypalCreateOrder)({ productDescription: productDescription, shortDescription: shortDescription, totalPrice: totalPrice })]; case 4: paypalResponse = _b.sent(); - if (paypalResponse.ok) { - response.status(200).json({ - orderId: paypalResponse.id, - }); - } - else { - throw new Error("PayPal returned ".concat(paypalResponse.statusCode, " ").concat(paypalResponse.statusMessage)); - } + response.status(200).json({ + orderId: paypalResponse.id, + }); return [3 /*break*/, 6]; case 5: err_1 = _b.sent(); |
