From 948396662be473a5e31126b67b8dfcc4f2a62e69 Mon Sep 17 00:00:00 2001 From: Lauren Liberda Date: Sat, 24 Jul 2021 17:01:11 +0200 Subject: [PATCH] fix item creating with ean13 parent codes --- src/items/dto/new-item.input.ts | 2 +- src/items/items.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/items/dto/new-item.input.ts b/src/items/dto/new-item.input.ts index 75c00b4..b1f0a2f 100644 --- a/src/items/dto/new-item.input.ts +++ b/src/items/dto/new-item.input.ts @@ -12,5 +12,5 @@ export class NewItemInput { notes?: string; @Field((type) => ID, { nullable: true }) - parent?: number; + parent?: string; } diff --git a/src/items/items.service.ts b/src/items/items.service.ts index 7fea028..ca100e1 100644 --- a/src/items/items.service.ts +++ b/src/items/items.service.ts @@ -104,7 +104,7 @@ export class ItemsService { : // @ts-ignore input.id must exist here this.eans.toID(input.id), parent: input.parent - ? await this.itemRepository.findOneOrFail(input.parent) + ? await this.itemRepository.findOneOrFail(this.eans.toID(input.parent)) : undefined, });