fix(edgejobs): sort logs result in UI EE-5304 (#8746)

pull/8989/head
matias-portainer 2023-05-22 12:25:43 -03:00 committed by GitHub
parent c193360741
commit 8acea44ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import angular from 'angular';
import _ from 'lodash-es';
import { ScheduleCreateRequest, ScheduleUpdateRequest } from '@/portainer/models/schedule';
@ -26,7 +27,9 @@ function EdgeJobService(EdgeJobs, EdgeJobResults, FileUploadService) {
service.jobResults = jobResults;
async function jobResults(edgeJobId) {
try {
return await EdgeJobResults.query({ id: edgeJobId }).$promise;
const results = await EdgeJobResults.query({ id: edgeJobId }).$promise;
return _.sortBy(results, ['Id']);
} catch (err) {
throw { msg: 'Unable to retrieve results associated to the edgeJob', err: err };
}