add course dropdown values

This commit is contained in:
Mikayla Dobson
2023-02-18 12:21:50 -06:00
parent e89067d942
commit e7a27d7fe9
4 changed files with 38 additions and 4 deletions

View File

@@ -11,4 +11,15 @@ export default class Dropdown {
throw new Error(error);
}
}
async getCourses() {
try {
const statement = `SELECT * FROM recipin.dropdownVals WHERE datatype = 'COURSE'`;
const result = await pool.query(statement);
if (result.rows.length) return result.rows;
return null;
} catch (error: any) {
throw new Error(error);
}
}
}