summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-08 08:06:45 +0100
committerJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-08 08:06:45 +0100
commitbf749ae1600696efc55ebf1cf44c7637afa8b0c7 (patch)
tree7ee7e7556441bf44d09e723fba9271ca7cc2fec9
parent2871b154a0bf49eb18d460bf62488fe969252dd6 (diff)
createPaypalOrder sends 201 CREATED
-rw-r--r--api-src/createPaypalOrder.ts2
-rw-r--r--api/createPaypalOrder.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/api-src/createPaypalOrder.ts b/api-src/createPaypalOrder.ts
index 182bf50..aba6ce7 100644
--- a/api-src/createPaypalOrder.ts
+++ b/api-src/createPaypalOrder.ts
@@ -18,7 +18,7 @@ export default async function handler(request: VercelRequest, response: VercelRe
} else {
try {
const paypalResponse = await paypalCreateOrder({ productDescription, shortDescription, totalPrice });
- response.status(200).json({
+ response.status(201).json({
orderId: paypalResponse.id,
});
} catch (err) {
diff --git a/api/createPaypalOrder.js b/api/createPaypalOrder.js
index d477371..0c85151 100644
--- a/api/createPaypalOrder.js
+++ b/api/createPaypalOrder.js
@@ -64,7 +64,7 @@ function handler(request, response) {
return [4 /*yield*/, (0, _paypal_1.paypalCreateOrder)({ productDescription: productDescription, shortDescription: shortDescription, totalPrice: totalPrice })];
case 4:
paypalResponse = _b.sent();
- response.status(200).json({
+ response.status(201).json({
orderId: paypalResponse.id,
});
return [3 /*break*/, 6];