mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-10 22:00:43 -04:00
20 lines
419 B
JavaScript
20 lines
419 B
JavaScript
export default function hikesService(app) {
|
|
const Challenge = app.models.Challenge;
|
|
|
|
return {
|
|
name: 'hikes',
|
|
read: (req, resource, params, config, cb) => {
|
|
const query = {
|
|
where: { challengeType: '6' },
|
|
order: 'difficulty ASC'
|
|
};
|
|
Challenge.find(query, (err, hikes) => {
|
|
if (err) {
|
|
return cb(err);
|
|
}
|
|
cb(null, hikes);
|
|
});
|
|
}
|
|
};
|
|
}
|