IO-3166-Global-Notifications-Part-2: checkpoint
This commit is contained in:
@@ -258,8 +258,17 @@ const jobStatusChangeBuilder = (data) => {
|
|||||||
const newMediaAddedReassignedBuilder = (data) => {
|
const newMediaAddedReassignedBuilder = (data) => {
|
||||||
// Determine if it's an image or document
|
// Determine if it's an image or document
|
||||||
const mediaType = data?.data?.type?.startsWith("image") ? "Image" : "Document";
|
const mediaType = data?.data?.type?.startsWith("image") ? "Image" : "Document";
|
||||||
// Determine if it's added or updated
|
|
||||||
const action = data.isNew ? "added" : "updated";
|
// Determine the action
|
||||||
|
let action;
|
||||||
|
if (data.isNew) {
|
||||||
|
action = "added"; // New media
|
||||||
|
} else if (data.changedFields?.jobid && data.changedFields.jobid.old !== data.changedFields.jobid.new) {
|
||||||
|
action = "reassigned to Job";
|
||||||
|
} else {
|
||||||
|
action = "updated";
|
||||||
|
}
|
||||||
|
|
||||||
// Construct the body string
|
// Construct the body string
|
||||||
const body = `An ${mediaType} has been ${action}.`;
|
const body = `An ${mediaType} has been ${action}.`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user