fix challenge ordering
Now challenges are ordered on map first by top order value of json file second by index of array
This commit is contained in:
@ -22,6 +22,9 @@
|
|||||||
"order": {
|
"order": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
"suborder": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"dashedName": {
|
"dashedName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -63,7 +63,8 @@ Challenge.destroyAll(function(err, info) {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(/\:/g, '')
|
.replace(/\:/g, '')
|
||||||
.replace(/\s/g, '-');
|
.replace(/\s/g, '-');
|
||||||
challenge.order = +('' + order + (index + 1));
|
challenge.order = order;
|
||||||
|
challenge.suborder = index + 1;
|
||||||
challenge.block = block;
|
challenge.block = block;
|
||||||
|
|
||||||
return challenge;
|
return challenge;
|
||||||
|
@ -458,7 +458,10 @@ module.exports = function(app) {
|
|||||||
.map(camperCount => numberWithCommas(camperCount));
|
.map(camperCount => numberWithCommas(camperCount));
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
order: 'order ASC'
|
order: [
|
||||||
|
'order ASC',
|
||||||
|
'suborder ASC'
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
// create a stream of all the challenges
|
// create a stream of all the challenges
|
||||||
|
Reference in New Issue
Block a user