mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
⚡ Reformat workflow deletion date to UTC
This commit is contained in:
parent
f096136c37
commit
ca9628bc6d
|
@ -117,6 +117,8 @@ import { TagEntity } from './databases/entities/TagEntity';
|
||||||
import { WorkflowEntity } from './databases/entities/WorkflowEntity';
|
import { WorkflowEntity } from './databases/entities/WorkflowEntity';
|
||||||
import { WorkflowNameRequest } from './WorkflowHelpers';
|
import { WorkflowNameRequest } from './WorkflowHelpers';
|
||||||
|
|
||||||
|
import { DateUtils } from 'typeorm/util/DateUtils';
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
|
|
||||||
app: express.Application;
|
app: express.Application;
|
||||||
|
@ -1783,8 +1785,11 @@ class App {
|
||||||
const deleteData = req.body as IExecutionDeleteFilter;
|
const deleteData = req.body as IExecutionDeleteFilter;
|
||||||
|
|
||||||
if (deleteData.deleteBefore !== undefined) {
|
if (deleteData.deleteBefore !== undefined) {
|
||||||
|
// date reformatting needed - see https://github.com/typeorm/typeorm/issues/2286
|
||||||
|
const utcDeleteBefore = DateUtils.mixedDateToUtcDatetimeString(deleteData.deleteBefore);
|
||||||
|
|
||||||
const filters = {
|
const filters = {
|
||||||
startedAt: LessThanOrEqual(deleteData.deleteBefore),
|
startedAt: LessThanOrEqual(utcDeleteBefore),
|
||||||
};
|
};
|
||||||
if (deleteData.filters !== undefined) {
|
if (deleteData.filters !== undefined) {
|
||||||
Object.assign(filters, deleteData.filters);
|
Object.assign(filters, deleteData.filters);
|
||||||
|
|
Loading…
Reference in a new issue