Skip to content

Commit

Permalink
wrap id in shopify gid url for ease of use
Browse files Browse the repository at this point in the history
this just makes it easier to call from the frontend with the .sku
property
  • Loading branch information
chill389cc committed Dec 9, 2024
1 parent 23fe5ad commit 0a93e58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/shopify/inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export async function getProductInventoryLocation (
productId: string
): Promise<InventoryLocation[] | null> {
const { data, errors } = await client.request(getProductLocationsQuery, {
id: productId
id: `gid://shopify/Product/${productId}`
}) as { data: Record<string, any>, errors: unknown }

if (errors != null) {
Expand Down
1 change: 1 addition & 0 deletions shared/src/model/inventory.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const VariantInventoryItemSchema = Type.Object({
export type VariantInventoryItem = Static<typeof VariantInventoryItemSchema>

export const UpdateInventoryRequestSchema = Type.Object({
// This productId is in the form of a raw number(as a string) like 7507889357006, not wrapped in a shopify gid url
productId: Type.Optional(Type.String()),
variantId: Type.Optional(Type.String()),
locationId: Type.Optional(Type.String()),
Expand Down

0 comments on commit 0a93e58

Please sign in to comment.