Skip to content

Commit

Permalink
Merge pull request #62 from logion-network/feature/order_locs
Browse files Browse the repository at this point in the history
feat: sort loc requests by creation date.
  • Loading branch information
benoitdevos authored Dec 16, 2021
2 parents 9940e7f + 58f1932 commit eabae1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/logion/model/locrequest.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,12 @@ export class LocRequestRepository {
{ expectedLocTypes: specification.expectedLocTypes });
}

if (specification.expectedStatuses &&
(specification.expectedStatuses.includes("OPEN") || specification.expectedStatuses.includes("CLOSED"))) {
builder.orderBy("request.loc_created_on", "DESC")
} else {
builder.orderBy("request.created_on", "DESC")
}
return builder.getMany();
}
}
Expand Down

0 comments on commit eabae1a

Please sign in to comment.