Skip to content

Commit

Permalink
Katha #1216 - In the update session email 'Duration' is updating in t…
Browse files Browse the repository at this point in the history
…he original details when user updated the session time.
  • Loading branch information
adithyadinesh0412 committed Feb 19, 2024
1 parent 5f66495 commit 1015c9b
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 1015c9b

Please sign in to comment.