Skip to content

Commit

Permalink
Default-sort variable keyvalues at serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Jul 24, 2023
1 parent 55723e5 commit baeb110
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ui/app/serializers/variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ export default class VariableSerializer extends ApplicationSerializer {
if (!hash.Items) {
hash.Items = { '': '' };
}
hash.KeyValues = Object.entries(hash.Items).map(([key, value]) => {
return {
key,
value,
};
});
hash.KeyValues = Object.entries(hash.Items)
.map(([key, value]) => {
return {
key,
value,
};
})
.sort((a, b) => a.key.localeCompare(b.key));
delete hash.Items;
return super.normalizeFindRecordResponse(
store,
Expand Down

0 comments on commit baeb110

Please sign in to comment.