From 308b593763c3d0cdfe3708257fef1cc44d3e7bc4 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 27 Feb 2019 11:24:04 +0100 Subject: [PATCH] check for invalid motions on import --- .../app/site/motions/services/motion-import.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/motions/services/motion-import.service.ts b/client/src/app/site/motions/services/motion-import.service.ts index 74a950403..80a91b5d7 100644 --- a/client/src/app/site/motions/services/motion-import.service.ts +++ b/client/src/app/site/motions/services/motion-import.service.ts @@ -122,12 +122,19 @@ export class MotionImportService extends BaseImportService { } } const updateModels = this.repo.getMotionDuplicates(newEntry); - return { + const entry: NewEntry = { newEntry: newEntry, duplicates: updateModels, status: updateModels.length ? 'error' : 'new', errors: updateModels.length ? ['Duplicates'] : [] }; + if (!entry.newEntry.title) { + this.setError(entry, 'Title'); + } + if (!entry.newEntry.text) { + this.setError(entry, 'Title'); + } + return entry; } /**