Skip to content

Commit

Permalink
fix: sort versions by created-date (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo authored Oct 29, 2021
1 parent aaa4215 commit 0addf38
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/src/data/getAllAppsByDeveloperId.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const getAllAppsByDeveloperId = (id, knex) => {
.where({
developer_id: id,
})
.orderBy('version_created_at', 'desc')
}

module.exports = getAllAppsByDeveloperId
1 change: 1 addition & 0 deletions server/src/data/getAllAppsByLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const getAllAppsByLanguage = (languageCode, knex) => {
.where({
language_code: languageCode,
})
.orderBy('version_created_at', 'desc')
}

module.exports = getAllAppsByLanguage
1 change: 1 addition & 0 deletions server/src/data/getAppById.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const getAppById = async (appId, languageCode, knex) => {
app_id: appId,
language_code: languageCode,
})
.orderBy('version_created_at', 'desc')
} catch (err) {
throw new Error(`Could not get app with id: ${appId}. ${err.message}`)
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/data/getApps.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const getApps = (
})
}
})
.orderBy('name')
.orderBy(['name', { column: 'version_created_at', order: 'desc' }])
}

module.exports = getApps
1 change: 1 addition & 0 deletions server/src/data/getAppsById.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const getAppsById = async (id, languageCode, knex) => {
app_id: id,
language_code: languageCode,
})
.orderBy('version_created_at', 'desc')

return apps
} catch (err) {
Expand Down
1 change: 1 addition & 0 deletions server/src/data/getAppsByIdAndStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const getAppsByIdAndStatus = (id, status, languageCode, knex) => {
status,
language_code: languageCode,
})
.orderBy('version_created_at', 'desc')
}

module.exports = getAppsByIdAndStatus

0 comments on commit 0addf38

Please sign in to comment.