Merge pull request #17957 from overleaf/ab-archive-test-slack-notif-date

[web] Send correct date for Slack notification when archiving a split test

GitOrigin-RevId: acf39915e3362f90b431b6c973e1191428acd9c9
This commit is contained in:
Alexandre Bourdin 2024-04-18 15:54:26 +02:00 committed by Copybot
parent bee4c95c28
commit cdf4f98c87

View file

@ -29,6 +29,8 @@ async function sendNotification(splitTest, action, user) {
),
].join('\n')
const date = splitTest.archived ? splitTest.archivedAt : lastVersion.createdAt
const payload = {
name: splitTest.name,
action,
@ -38,9 +40,7 @@ async function sendNotification(splitTest, action, user) {
variantsConfig,
active: lastVersion.active.toString(),
author: user.email,
date:
moment(lastVersion.createdAt).utc().format('Do MMM YYYY, h:mm a') +
' UTC',
date: moment(date).utc().format('Do MMM YYYY, h:mm a') + ' UTC',
comment: lastVersion.comment ? `with comment: ${lastVersion.comment}` : '',
versionNumber: `${lastVersion.versionNumber}`,
url: `${Settings.siteUrl}/admin/split-test/edit/${splitTest.name}`,