diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-08 08:14:29 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-08 08:18:27 +0100 |
| commit | c3950f3de28e7ac1e677f4006521ffbed5db4ee0 (patch) | |
| tree | c5f69297c6f289ec46f95bcd7df65001474eee47 | |
| parent | 4a5bd8bf5e3c6017794d7c5c7eb4f2794a902245 (diff) | |
Renames createPaypalOrder -> create-paypal-order
| -rw-r--r-- | api-src/_Order.d.ts (renamed from api-src/Order.d.ts) | 0 | ||||
| -rw-r--r-- | api-src/_paypal.ts | 2 | ||||
| -rw-r--r-- | api-src/order.ts (renamed from api-src/createPaypalOrder.ts) | 2 | ||||
| -rw-r--r-- | api/Order.js (renamed from api/createPaypalOrder.js) | 7 | ||||
| -rw-r--r-- | api/Order.js.map | 1 | ||||
| -rw-r--r-- | api/createPaypalOrder.js.map | 1 | ||||
| -rw-r--r-- | api/package.json | 3 |
7 files changed, 9 insertions, 7 deletions
diff --git a/api-src/Order.d.ts b/api-src/_Order.d.ts index cf1ff81..cf1ff81 100644 --- a/api-src/Order.d.ts +++ b/api-src/_Order.d.ts diff --git a/api-src/_paypal.ts b/api-src/_paypal.ts index 348c972..99e45f7 100644 --- a/api-src/_paypal.ts +++ b/api-src/_paypal.ts @@ -1,4 +1,4 @@ -import type Order from './Order'; +import type Order from './_Order'; import env from './_env'; export async function paypalCreateOrder(order: Order) { diff --git a/api-src/createPaypalOrder.ts b/api-src/order.ts index 676d788..8937d04 100644 --- a/api-src/createPaypalOrder.ts +++ b/api-src/order.ts @@ -1,5 +1,5 @@ import type { VercelRequest, VercelResponse } from '@vercel/node'; -import type Order from './Order'; +import type Order from './_Order'; import { paypalCreateOrder } from './_paypal'; export default async function handler(request: VercelRequest, response: VercelResponse) { diff --git a/api/createPaypalOrder.js b/api/Order.js index ac8ead0..95ff8ab 100644 --- a/api/createPaypalOrder.js +++ b/api/Order.js @@ -44,6 +44,11 @@ function handler(request, response) { switch (_b.label) { case 0: _a = request.body, productDescription = _a.productDescription, shortDescription = _a.shortDescription, totalPrice = _a.totalPrice; + if (request.method !== 'POST') { + console.warn('Method was not POST. Method was ' + request.method); + response.status(404); + return [2 /*return*/]; + } if (!!productDescription) return [3 /*break*/, 1]; response.status(400).send('Expected body to contain productDescription, but none provided.'); return [3 /*break*/, 6]; @@ -74,4 +79,4 @@ function handler(request, response) { }); } exports.default = handler; -//# sourceMappingURL=createPaypalOrder.js.map
\ No newline at end of file +//# sourceMappingURL=order.js.map
\ No newline at end of file diff --git a/api/Order.js.map b/api/Order.js.map new file mode 100644 index 0000000..df4cbcf --- /dev/null +++ b/api/Order.js.map @@ -0,0 +1 @@ +{"version":3,"file":"order.js","sourceRoot":"","sources":["../api-src/order.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,qCAA8C;AAE9C,SAA8B,OAAO,CAAC,OAAsB,EAAE,QAAwB;;;;;;oBAC9E,KAAuE,OAAO,CAAC,IAAI,EAAjF,kBAAkB,wBAAA,EAAE,gBAAgB,sBAAA,EAAE,UAAU,gBAAA,CAAkC;oBAE1F,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;wBAC7B,OAAO,CAAC,IAAI,CAAC,kCAAkC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;wBAClE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBACrB,sBAAO;qBACR;yBAEG,CAAC,kBAAkB,EAAnB,wBAAmB;oBACrB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;;;yBACpF,CAAC,gBAAgB,EAAjB,wBAAiB;oBAC1B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;;;yBAClF,CAAC,UAAU,EAAX,wBAAW;oBACpB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;;;;oBAG5D,qBAAM,IAAA,2BAAiB,EAAC,EAAE,kBAAkB,oBAAA,EAAE,gBAAgB,kBAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;oBAA9F,cAAc,GAAG,SAA6E;oBACpG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;wBACxB,OAAO,EAAE,cAAc,CAAC,EAAE;qBAC3B,CAAC,CAAC;;;;oBAEH,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iCAA0B,KAAG,CAAE,CAAC,CAAC;;;;;;CAGhE;AAzBD,0BAyBC"}
\ No newline at end of file diff --git a/api/createPaypalOrder.js.map b/api/createPaypalOrder.js.map deleted file mode 100644 index 2610715..0000000 --- a/api/createPaypalOrder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createPaypalOrder.js","sourceRoot":"","sources":["../api-src/createPaypalOrder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,qCAA8C;AAE9C,SAA8B,OAAO,CAAC,OAAsB,EAAE,QAAwB;;;;;;oBAC9E,KAAuE,OAAO,CAAC,IAAI,EAAjF,kBAAkB,wBAAA,EAAE,gBAAgB,sBAAA,EAAE,UAAU,gBAAA,CAAkC;yBAEtF,CAAC,kBAAkB,EAAnB,wBAAmB;oBACrB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;;;yBACpF,CAAC,gBAAgB,EAAjB,wBAAiB;oBAC1B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;;;yBAClF,CAAC,UAAU,EAAX,wBAAW;oBACpB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;;;;oBAG5D,qBAAM,IAAA,2BAAiB,EAAC,EAAE,kBAAkB,oBAAA,EAAE,gBAAgB,kBAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;oBAA9F,cAAc,GAAG,SAA6E;oBACpG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;wBACxB,OAAO,EAAE,cAAc,CAAC,EAAE;qBAC3B,CAAC,CAAC;;;;oBAEH,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iCAA0B,KAAG,CAAE,CAAC,CAAC;;;;;;CAGhE;AAnBD,0BAmBC"}
\ No newline at end of file diff --git a/api/package.json b/api/package.json deleted file mode 100644 index c9a4422..0000000 --- a/api/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -}
\ No newline at end of file |
