Skip to content

Commit

Permalink
Merge pull request #610 from adithyadinesh0412/notify-user-in-sessions
Browse files Browse the repository at this point in the history
Katha #1216 - In the update session email 'Duration' is updating in t…
  • Loading branch information
rakeshSgr authored Feb 19, 2024
2 parents 47ed57e + 1015c9b commit 40f21a0
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
'use strict'

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
const defaultOrgId = queryInterface.sequelize.options.defaultOrgId
if (!defaultOrgId) {
throw new Error('Default org ID is undefined. Please make sure it is set in sequelize options.')
}
// update the body correct the end date and time
let updateData = {
body: '<p>Dear {name},</p> Please note that the Mentor has rescheduled the session - {sessionTitle} from {oldStartDate} {oldStartTime} - {oldEndDate} {oldEndTime} to {newStartDate} {newStartTime} - {newEndDate} {newEndTime} Please make note of the changes.',
}
let updateFilter = {
code: 'mentor_session_reschedule',
organization_id: defaultOrgId,
}
// Update operation
let check = await queryInterface.bulkUpdate('notification_templates', updateData, updateFilter)
},

async down(queryInterface, Sequelize) {
const defaultOrgId = queryInterface.sequelize.options.defaultOrgId
if (!defaultOrgId) {
throw new Error('Default org ID is undefined. Please make sure it is set in sequelize options.')
}
let updateData = {
body: '<p>Dear {name},</p> Please note that the Mentor has rescheduled the session - {sessionTitle} from {oldStartDate} {oldStartTime} - {oldEndDate} {oldEndTime} to {newStartDate} {newStartTime} - {newStartDate} {newStartTime} Please make note of the changes.',
}
let updateFilter = {
code: 'mentor_session_reschedule',
organization_id: defaultOrgId,
}
// Update operation
let check = await queryInterface.bulkUpdate('notification_templates', updateData, updateFilter)
},
}

0 comments on commit 40f21a0

Please sign in to comment.