@things-factory/product-base 7.1.24 → 7.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-base",
3
- "version": "7.1.24",
3
+ "version": "7.1.25",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -28,5 +28,5 @@
28
28
  "@things-factory/env": "^7.1.16",
29
29
  "@things-factory/routing-base": "^7.1.24"
30
30
  },
31
- "gitHead": "1838925b39cce3caa8e49a6dd2c15796af567695"
31
+ "gitHead": "99180f1ee824d20cd9521b432c3a2bdd1f600354"
32
32
  }
@@ -278,14 +278,14 @@ export class ProductQuery {
278
278
  }
279
279
 
280
280
  @FieldResolver(type => String, { nullable: true })
281
- async warehouseId(@Root() product: Product): Promise<String | undefined> {
282
- if (!product.warehouseName) return null
281
+ async warehouseName(@Root() product: Product): Promise<String | undefined> {
282
+ if (!product.warehouseId) return null
283
283
 
284
284
  const items = await getRepository(Product).query(`
285
- SELECT w.id as "warehouseId" FROM products p LEFT JOIN warehouses w ON p.warehouse_name = w.name and w.domain_id = p.domain_id WHERE p.id = '${product.id}'
285
+ SELECT w.name as "warehouseName" FROM products p LEFT JOIN warehouses w ON p.warehouse_id::uuid = w.id and w.domain_id = p.domain_id WHERE p.id = '${product.id}'
286
286
  `)
287
287
 
288
- return items[0].warehouseId || null
288
+ return items[0].warehouseName || null
289
289
  }
290
290
  }
291
291
 
@@ -185,7 +185,7 @@ export class NewProduct {
185
185
  routing?: ObjectRef
186
186
 
187
187
  @Field({ nullable: true })
188
- warehouseName?: string
188
+ warehouseId?: string
189
189
 
190
190
  @Field(type => GraphQLUpload, { nullable: true })
191
191
  thumbnail?: FileUpload
@@ -413,7 +413,7 @@ export class ProductPatch {
413
413
  routing?: ObjectRef
414
414
 
415
415
  @Field({ nullable: true })
416
- warehouseName?: string
416
+ warehouseId?: string
417
417
 
418
418
  @Field(type => GraphQLUpload, { nullable: true })
419
419
  thumbnail?: FileUpload
@@ -456,7 +456,7 @@ export class Product {
456
456
 
457
457
  @Column({ nullable: true })
458
458
  @Field(type => String, { nullable: true })
459
- warehouseName?: string
459
+ warehouseId?: string
460
460
 
461
461
  @Field(type => String, { nullable: true })
462
462
  thumbnail?: string