mailing UI tweaks and bugs fixed

This commit is contained in:
Dobromir Popov
2024-04-06 12:38:02 +03:00
parent fdbf2642cc
commit 7f4ba3545c
3 changed files with 16 additions and 15 deletions

View File

@ -131,7 +131,10 @@ export default async function handler(req, res) {
const shiftStr = `${CON.weekdaysBG[assignment.shift.startTime.getDay()]} ${CON.GetDateFormat(assignment.shift.startTime)} at ${assignment.shift.cartEvent.location.name} from ${CON.GetTimeFormat(assignment.shift.startTime)} to ${CON.GetTimeFormat(assignment.shift.endTime)}`;
const allNewPubNames = newAssignment.shift.assignments.map(a => a.publisher.firstName + " " + a.publisher.lastName + "\t\t" + a.publisher.phone + "").join("</br>");
const newPubs = newAssignment.shift.assignments.map(a => ({
name: `${a.publisher.firstName} ${a.publisher.lastName}`,
phone: a.publisher.phone
}));
let model = {
user: publisher,
@ -141,7 +144,7 @@ export default async function handler(req, res) {
oldPubName: assignment.publisher.firstName + " " + assignment.publisher.lastName,
firstName: publisher.firstName,
lastName: publisher.lastName,
newPubNames: allNewPubNames,
newPubs: newPubs,
placeName: assignment.shift.cartEvent.location.name,
dateStr: common.getDateFormated(assignment.shift.startTime),
time: common.formatTimeHHmm(assignment.shift.startTime),
@ -150,15 +153,9 @@ export default async function handler(req, res) {
emailHelper.SendEmailHandlebars(to, "coverMeAccepted", model);
// await prisma.user.update({
// where: {
// id: parseInt(userId)
// },
// data: {
// status: "accepted",
// acceptedAt: date
// }
// });
const messagePageUrl = `/message?message=${encodeURIComponent('Вашата заявка за замстване е обработена успешно')}&type=info&caption=${encodeURIComponent('Благодарим ви!')}`;
res.redirect(messagePageUrl);
break;
//POST