aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-10-04 06:37:46 +0000
committerAdam Soltys <[email protected]>2023-10-04 06:37:48 +0000
commitd5e12043d8619ffeed6eb46b5a7cb5d7c1b724d9 (patch)
tree17692992f343a75f739461d8277720e0c7568e95
parentc5b765c5cc12d4e21135a613b3c04a72cabe9b85 (diff)
downloadcoinos-server-d5e12043d8619ffeed6eb46b5a7cb5d7c1b724d9.tar.gz
coinos-server-d5e12043d8619ffeed6eb46b5a7cb5d7c1b724d9.zip
catch shopify errors
-rw-r--r--routes/shopify.js36
1 files changed, 18 insertions, 18 deletions
diff --git a/routes/shopify.js b/routes/shopify.js
index ddb290df..aaecbed0 100644
--- a/routes/shopify.js
+++ b/routes/shopify.js
@@ -17,24 +17,24 @@ export default async ({ body: { hash }, params: { id } }, res) => {
let user = await g(`user:${p.uid}`);
try {
- let r = await got
- .post(
- `https://${user.shopifyStore}.myshopify.com/admin/api/2023-07/graphql.json`,
- {
- headers: {
- "Content-Type": "application/json",
- "X-Shopify-Access-Token": user.shopifyToken
- },
- json: {
- query,
- variables: { input: { id: `gid://shopify/Order/${id}` } }
+ let r = await got
+ .post(
+ `https://${user.shopifyStore}.myshopify.com/admin/api/2023-07/graphql.json`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Shopify-Access-Token": user.shopifyToken,
+ },
+ json: {
+ query,
+ variables: { input: { id: `gid://shopify/Order/${id}` } },
+ },
}
- }
- )
- .json();
- } catch(e) {
- err("problem marking shopify order as paid", e.message);
- }
+ )
+ .json();
- res.send(r);
+ res.send(r);
+ } catch (e) {
+ err("problem marking shopify order as paid", e.message);
+ }
};