Fixed date format for link bulk edit

refs https://github.com/TryGhost/Team/issues/2104

- updates date format for `updated_at` to use the right DB date format
This commit is contained in:
Rishabh 2022-10-21 16:51:24 +05:30
parent b552727b69
commit 86a9695ccb
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ const errors = require('@tryghost/errors');
const nql = require('@tryghost/nql');
const _ = require('lodash');
const tpl = require('@tryghost/tpl');
const moment = require('moment');
/**
* @typedef {object} ILinkClickRepository
@ -171,7 +172,7 @@ class LinkClickTrackingService {
const bulkUpdateOptions = _.pick(options, ['transacting']);
const updateData = {
to: this.#urlUtils.absoluteToTransformReady(newRedirectUrl.href),
updated_at: new Date()
updated_at: moment().format('YYYY-MM-DD HH:mm:ss')
};
return await this.#postLinkRepository.updateLinks(linkIds, updateData, bulkUpdateOptions);

View File

@ -29,6 +29,7 @@
"@tryghost/errors": "1.2.18",
"@tryghost/tpl": "0.1.18",
"@tryghost/nql": "0.9.2",
"lodash": "4.17.21"
"lodash": "4.17.21",
"moment": "2.29.4"
}
}