Some fixes
This commit is contained in:
parent
51970e0435
commit
d6d358f579
1
package-lock.json
generated
1
package-lock.json
generated
@ -170,7 +170,6 @@
|
||||
"@babel/helper-module-transforms": "^7.22.20",
|
||||
"@babel/helpers": "^7.22.15",
|
||||
"@babel/parser": "^7.22.16",
|
||||
"@babel/parser": "^7.22.16",
|
||||
"@babel/template": "^7.22.15",
|
||||
"@babel/traverse": "^7.22.20",
|
||||
"@babel/types": "^7.22.19",
|
||||
|
@ -10,12 +10,12 @@ import authHandler from "@App/middlewares/AuthHandler";
|
||||
import ruleHandler from "@App/middlewares/RulesHandler";
|
||||
import documentHandler from "@App/middlewares/OfficeMembershipHandlers/DocumentHandler";
|
||||
import EmailBuilder from "@Common/emails/EmailBuilder";
|
||||
import NotificationBuilder from "@Common/notifications/NotificationBuilder";
|
||||
// import NotificationBuilder from "@Common/notifications/NotificationBuilder";
|
||||
|
||||
@Controller()
|
||||
@Service()
|
||||
export default class DocumentsController extends ApiController {
|
||||
constructor(private documentsService: DocumentsService, private emailBuilder: EmailBuilder, private notificationBuilder: NotificationBuilder) {
|
||||
constructor(private documentsService: DocumentsService, private emailBuilder: EmailBuilder) {
|
||||
super();
|
||||
}
|
||||
|
||||
@ -113,8 +113,8 @@ export default class DocumentsController extends ApiController {
|
||||
const documentEntityUpdated: Documents = await this.documentsService.update(uid, documentEntity, req.body.refused_reason);
|
||||
|
||||
//create email for asked document
|
||||
this.emailBuilder.sendDocumentEmails(documentEntityUpdated);
|
||||
this.notificationBuilder.sendDocumentAnchoredNotificatiom(documentEntityUpdated);
|
||||
// this.emailBuilder.sendDocumentEmails(documentEntityUpdated);
|
||||
// this.notificationBuilder.sendDocumentAnchoredNotificatiom(documentEntityUpdated);
|
||||
|
||||
//Hydrate ressource with prisma entity
|
||||
const document = Document.hydrate<Document>(documentEntityUpdated, { strategy: "excludeAll" });
|
||||
|
@ -27,7 +27,7 @@ export default class NotificationBuilder {
|
||||
}
|
||||
|
||||
public async sendDocumentAnchoredNotificatiom(documentEntity: Documents){
|
||||
if(documentEntity.document_status !== "ANCHORED") return;
|
||||
|
||||
|
||||
const documentPrisma = await this.documentsService.getByUid(documentEntity.uid, { depositor: {include: {contact: true}}, folder:{include:{ office: true, stakeholders: true}} });
|
||||
if(!documentPrisma) throw new Error("Document not found");
|
||||
|
Loading…
x
Reference in New Issue
Block a user