fix item creating with ean13 parent codes

This commit is contained in:
Lauren Liberda 2021-07-24 17:01:11 +02:00
parent e52ae61590
commit 948396662b
2 changed files with 2 additions and 2 deletions

View file

@ -12,5 +12,5 @@ export class NewItemInput {
notes?: string; notes?: string;
@Field((type) => ID, { nullable: true }) @Field((type) => ID, { nullable: true })
parent?: number; parent?: string;
} }

View file

@ -104,7 +104,7 @@ export class ItemsService {
: // @ts-ignore input.id must exist here : // @ts-ignore input.id must exist here
this.eans.toID(input.id), this.eans.toID(input.id),
parent: input.parent parent: input.parent
? await this.itemRepository.findOneOrFail(input.parent) ? await this.itemRepository.findOneOrFail(this.eans.toID(input.parent))
: undefined, : undefined,
}); });