Skip to content

Commit

Permalink
populate db for teaser video (#179)
Browse files Browse the repository at this point in the history
* populate db for teaser video

* updating upper-case titles

* adding 'ORDER BY'
  • Loading branch information
Sylvie-Molinatto authored Jan 25, 2024
1 parent 617d805 commit 24b05c1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 26 deletions.
8 changes: 4 additions & 4 deletions backend/src/dao/utils_dao.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const db = require('../services/db');
* @returns {Promise<TeacherRow>}
*/
exports.getTeacherListExcept = async (id) => {
const query = `SELECT * FROM teacher WHERE id <> ?; `;
const query = `SELECT * FROM teacher WHERE id <> ? ORDER BY name; `;

return db.prepare(query).all(id);
};
Expand All @@ -22,7 +22,7 @@ exports.getTeacherListExcept = async (id) => {
* @returns {Promise<ExternalCoSupervisorRow>}
*/
exports.getExternalCoSupervisorList = async () => {
const query = `SELECT * FROM externalCoSupervisor;`;
const query = `SELECT * FROM externalCoSupervisor ORDER BY name;`;

return db.prepare(query).all();
};
Expand All @@ -33,7 +33,7 @@ exports.getExternalCoSupervisorList = async () => {
* @returns {Promise<string[]>}
*/
exports.getAllKeywords = async () => {
const getKeywords = `SELECT DISTINCT(keyword) FROM proposalKeyword`;
const getKeywords = `SELECT DISTINCT(keyword) FROM proposalKeyword ORDER BY keyword;`;
const res = db.prepare(getKeywords).all();
// Extracting the keyword property from each row
return res.map( row => row.keyword );
Expand All @@ -45,7 +45,7 @@ exports.getAllKeywords = async () => {
* @returns {Promise<DegreeRow[]>}
*/
exports.getDegrees = async () => {
const getDegrees = `SELECT * FROM degree`;
const getDegrees = `SELECT * FROM degree ORDER BY title_degree;`;

return db.prepare(getDegrees).all();
};
Binary file modified database/database.sqlite
Binary file not shown.
Loading

0 comments on commit 24b05c1

Please sign in to comment.