diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index dde0e729b5..f2c55bc68b 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -853,8 +853,8 @@ class App { } const countFilter = JSON.parse(JSON.stringify(filter)); - if (req.query.lastStartedAt) { - filter.startedAt = LessThan(req.query.lastStartedAt); + if (req.query.lastId) { + filter.id = LessThan(req.query.lastId); } countFilter.select = ['id']; @@ -871,7 +871,7 @@ class App { ], where: filter, order: { - startedAt: "DESC", + id: 'DESC', }, take: limit, }); diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index d39a992ae1..1f096d5667 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -120,7 +120,7 @@ export interface IRestApi { getActiveWorkflows(): Promise; getActivationError(id: string): Promise; getCurrentExecutions(filter: object): Promise; - getPastExecutions(filter: object, limit: number, lastStartedAt?: Date): Promise; + getPastExecutions(filter: object, limit: number, lastId?: string | number): Promise; stopCurrentExecution(executionId: string): Promise; makeRestApiRequest(method: string, endpoint: string, data?: any): Promise; // tslint:disable-line:no-any getSettings(): Promise; diff --git a/packages/editor-ui/src/components/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsList.vue index fccf73ab7c..fd30d70660 100644 --- a/packages/editor-ui/src/components/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsList.vue @@ -333,16 +333,16 @@ export default mixins( this.isDataLoading = true; const filter = this.workflowFilter; - let lastStartedAt: Date | undefined; + let lastId: string | number | undefined; if (this.finishedExecutions.length !== 0) { const lastItem = this.finishedExecutions.slice(-1)[0]; - lastStartedAt = lastItem.startedAt as Date; + lastId = lastItem.id; } let data: IExecutionsListResponse; try { - data = await this.restApi().getPastExecutions(filter, this.requestItemsPerRequest, lastStartedAt); + data = await this.restApi().getPastExecutions(filter, this.requestItemsPerRequest, lastId); } catch (error) { this.isDataLoading = false; this.$showError(error, 'Problem loading workflows', 'There was a problem loading the workflows:'); diff --git a/packages/editor-ui/src/components/mixins/restApi.ts b/packages/editor-ui/src/components/mixins/restApi.ts index 6c07d35f59..09c0d74452 100644 --- a/packages/editor-ui/src/components/mixins/restApi.ts +++ b/packages/editor-ui/src/components/mixins/restApi.ts @@ -269,12 +269,12 @@ export const restApi = Vue.extend({ // Returns all saved executions // TODO: For sure needs some kind of default filter like last day, with max 10 results, ... - getPastExecutions: (filter: object, limit: number, lastStartedAt?: Date): Promise => { + getPastExecutions: (filter: object, limit: number, lastId?: string | number): Promise => { let sendData = {}; if (filter) { sendData = { filter, - lastStartedAt, + lastId, limit, }; }