-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
On the frontend we hard write the terms in the javascript itself—which isn't a lot of work as it's only updated every new term—isn't a good practice. There should always be a single source of truth.
<select
value={selectedTerm}
onChange={(e) => setSelectedTerm(e.currentTarget.value)}
style={{
WebkitAppearance: "none",
border: "none",
MozAppearance: "none",
appearance: "none",
}}
>
<option value="21/02">Winter 2021</option>
<option value="21/03">Spring 2021</option>
<option value="21/04">Summer I 2021 </option>
<option value="21/05">Summer II 2021</option>
<option value="21/01">Fall 2021</option>
</select>In the database, we provide both the term code and title required to make calls for a particular term.
It looks like this:
| termcode | title |
|---|---|
| 21/01 | Fall 2021 |
| 20/01 | Fall 2020 |
| 21/02 | Winter 2021 |
| 21/04 | Summer I 2021 |
| 21/05 | Summer II 2021 |
| 21/03 | Spring 2021 |
To prevent this code smell, an endpoint to query the db for terms is required.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request