-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Katha #1216 - In the update session email 'Duration' is updating in t…
…he original details when user updated the session time.
- Loading branch information
1 parent
5f66495
commit 1015c9b
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/database/migrations/20240219103552-update-mentor-session-reschedule.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
}, | ||
} |