mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Fixes issue with workflow lastUpdated field (#5015)
Fixed issue causing workflow updated field to be affected by statistics data
This commit is contained in:
@@ -169,15 +169,17 @@ workflowStatsController.get(
|
||||
// Get flag
|
||||
const workflowId = req.params.id;
|
||||
|
||||
// Get the corresponding workflow
|
||||
const workflow = await Db.collections.Workflow.findOne(workflowId);
|
||||
// It will be valid if we reach this point, this is just for TS
|
||||
if (!workflow) {
|
||||
return { dataLoaded: false };
|
||||
}
|
||||
// Get the flag
|
||||
const stats = await Db.collections.WorkflowStatistics.findOne({
|
||||
select: ['latestEvent'],
|
||||
where: {
|
||||
workflowId,
|
||||
name: StatisticsNames.dataLoaded,
|
||||
},
|
||||
});
|
||||
|
||||
const data: IWorkflowStatisticsDataLoaded = {
|
||||
dataLoaded: workflow.dataLoaded,
|
||||
dataLoaded: stats ? true : false,
|
||||
};
|
||||
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user