🐛 Allow deletion of a document with a file if status is refused
This commit is contained in:
parent
c414a5b1a6
commit
2d0517aa10
@ -51,7 +51,7 @@ export default class DocumentsService extends BaseService {
|
||||
if (!documentEntity) throw new Error("document not found");
|
||||
const document = Document.hydrate<Document>(documentEntity, { strategy: "excludeAll" });
|
||||
|
||||
if (document.files && document.files.length !== 0) {
|
||||
if (document.files && document.files.length !== 0 && document.document_status !== "REFUSED") {
|
||||
throw new Error("Can't delete a document with file");
|
||||
}
|
||||
return this.documentsRepository.delete(uid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user