Commit 30f6b716 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FEAT #15261 TIME 0:11 update function to send an email with a user without entities

parent 17c8d041
......@@ -453,14 +453,18 @@ export class SentResourcePageComponent implements OnInit {
this.emailsubject = `[${this.resourceData.chrono}] ${this.resourceData.subject}`;
this.emailsubject = this.emailsubject.substring(0, 70);
const withEmptyId = this.availableSenders.filter((element) => element.entityId === null);
Please register or sign in to reply
if (withEmptyId.length === 0) {
console.log(withEmptyId);
console.log(this.headerService.user.entities.length);
if (this.headerService.user.entities.length === 0) {
this.currentSender = withEmptyId[0];
Please register or sign in to reply
} else {
this.currentSender = this.availableSenders.filter(sender => sender.entityId === this.headerService.user.entities[0].id).length > 0 ? this.availableSenders.filter(sender => sender.entityId === this.headerService.user.entities[0].id)[0] : this.availableSenders[0];
}
if (!this.functions.empty(this.resourceData.senders)) {
this.resourceData.senders.forEach((sender: any) => {
this.setSender(sender.id);
});
}
}
}
setSender(id: number) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment