hotfix delete document

This commit is contained in:
Vincent Alamelle 2023-05-09 17:11:47 +02:00
parent 4faa88a80f
commit 6f90174f5f

View File

@ -47,7 +47,9 @@ export default class DocumentsService extends BaseService {
* @throws {Error} If document cannot be deleted
*/
public async delete(uid: string): Promise<Documents> {
const documentEntity = await this.documentsRepository.findOneByUid(uid, { office_folder_has_customers: true });
const documentEntity = await this.documentsRepository.findOneByUid(uid, { files: true });
console.log(documentEntity);
const document = Document.hydrate<Document>(documentEntity, { strategy: "excludeAll" });
if (document.files && document.files.length !== 0) {