Skip to content

Commit b0da856

Browse files
committed
feat(tatakforms): fetch only selected colleges
- chore(assets): replace csw logo
1 parent 8cc0da2 commit b0da856

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

assets/tatakform/colleges/csw.png

11.5 KB
Loading

src/db/models/college.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class College {
2121

2222
try {
2323
// Get all courses
24-
const colleges = await db.query<CollegeModel[]>(`SELECT * FROM colleges`);
24+
const colleges = await db.query<CollegeModel[]>(`SELECT * FROM colleges WHERE disabled = 0`);
2525

2626
// If no results
2727
if (colleges.length === 0) {
@@ -61,7 +61,7 @@ class College {
6161

6262
try {
6363
// Get college by acronym
64-
const college = await db.query<CollegeModel[]>(`SELECT * FROM colleges WHERE acronym = ? LIMIT 1`, [acronym]);
64+
const college = await db.query<CollegeModel[]>(`SELECT * FROM colleges WHERE disabled = 0 AND acronym = ? LIMIT 1`, [acronym]);
6565

6666
// If no results
6767
if (college.length === 0) {
@@ -107,7 +107,7 @@ class College {
107107
}
108108

109109
// Set the courses to the college
110-
const college = await db.query<CollegeModel[]>(`SELECT * FROM colleges WHERE id = ? LIMIT 1`, [courses[0].college_id]);
110+
const college = await db.query<CollegeModel[]>(`SELECT * FROM colleges WHERE disabled = 0 AND id = ? LIMIT 1`, [courses[0].college_id]);
111111

112112
// If no results
113113
if (college.length === 0) {

0 commit comments

Comments
 (0)