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);
|
const updateModels = this.repo.getMotionDuplicates(newEntry);
|
||||||
return {
|
const entry: NewEntry<ViewMotion> = {
|
||||||
newEntry: newEntry,
|
newEntry: newEntry,
|
||||||
duplicates: updateModels,
|
duplicates: updateModels,
|
||||||
status: updateModels.length ? 'error' : 'new',
|
status: updateModels.length ? 'error' : 'new',
|
||||||
errors: updateModels.length ? ['Duplicates'] : []
|
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