Skip to content

Commit

Permalink
Updated inventory checker
Browse files Browse the repository at this point in the history
  • Loading branch information
iskurbanov committed Sep 27, 2022
1 parent 67cc445 commit 290e9b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/available.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default async function send(req, res) {
async function getProduct(handle) {
const query = `
{
productByHandle(handle: "${handle}") {
product(handle: "${handle}") {
id
variants(first: 25) {
edges {
Expand All @@ -49,7 +49,7 @@ export default async function send(req, res) {

const response = await ShopifyData(query)

const product = response.data.productByHandle ? response.data.productByHandle : []
const product = response.data.product ? response.data.product : []

return product
}
Expand Down

0 comments on commit 290e9b6

Please sign in to comment.