diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-03 10:38:52 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-03 10:38:52 +0700 |
| commit | b4abdb00ef83aa824e8a05d5b75df48adb7b9629 (patch) | |
| tree | 86ce2454793fe31b54a87f151433cbf86dbed134 /src/pages/api | |
| parent | 31816dc3a6cb62e1480524c8f0065a7835fefdcd (diff) | |
semi dynamic page
Diffstat (limited to 'src/pages/api')
| -rw-r--r-- | src/pages/api/shop/midtrans-payment.js | 4 | ||||
| -rw-r--r-- | src/pages/api/shop/spell.js | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/pages/api/shop/midtrans-payment.js b/src/pages/api/shop/midtrans-payment.js index f7f29c7c..12aaa51f 100644 --- a/src/pages/api/shop/midtrans-payment.js +++ b/src/pages/api/shop/midtrans-payment.js @@ -22,7 +22,7 @@ export default async function handler(req, res) { {}, { Token: auth.token } ) - + if (!transaction?.id) { return res.status(400).json({ error: 'No Data' }) } @@ -57,7 +57,7 @@ export default async function handler(req, res) { customer_details: { first_name: transaction.address.customer.name, email: transaction.address.customer.email || '', - phone: transaction.address.customer.phone || '', + phone: transaction.address.customer.phone || '' } } diff --git a/src/pages/api/shop/spell.js b/src/pages/api/shop/spell.js index 634adb50..4c01765c 100644 --- a/src/pages/api/shop/spell.js +++ b/src/pages/api/shop/spell.js @@ -4,10 +4,9 @@ export default async function handler(req, res) { const { q = '' } = req.query let result = await axios( - process.env.SOLR_HOST + - `/solr/product/spell?indent=true&q.op=AND&q=${q}` + process.env.SOLR_HOST + `/solr/product/spell?indent=true&q.op=AND&q=${q}` ) - + try { res.status(200).json(result.data) } catch (error) { |
