check for invalid motions on import
This commit is contained in:
parent
e4c79fd371
commit
308b593763
@ -122,12 +122,19 @@ export class MotionImportService extends BaseImportService<ViewMotion> {
|
||||
}
|
||||
}
|
||||
const updateModels = this.repo.getMotionDuplicates(newEntry);
|
||||
return {
|
||||
const entry: NewEntry<ViewMotion> = {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user