-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Visual update and fix for scenario and scene selection (#259)
* style: extend emerald theme with VPS colours. * style: update style of home page side bar. * style: update styling of scenario and scene selection pages. * fix: fix fonts being loaded from wrong path when not on home page. * fix: fix invalid scenario ids crashing backend. * fix: fix inability to access scene selection screen without first going through the home page. * chore: fix prettier alerts. * style: differentiate non-editable thumbnail titles in ui. * fix: fix scroll being disabled in scene selection page. * style: reduce spacing between uoa logo and scenario action btns.
- Loading branch information
Showing
23 changed files
with
426 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import mongoose from "mongoose"; | ||
|
||
const HTTP_BAD_REQUEST = 400; | ||
|
||
/** | ||
* Checks if the scenarioId is valid | ||
*/ | ||
export default async function validScenarioId(req, res, next) { | ||
if ( | ||
req.params?.scenarioId && | ||
!mongoose.isValidObjectId(req.params.scenarioId) | ||
) { | ||
res.status(HTTP_BAD_REQUEST).json({ error: "Invalid scenario ID." }); | ||
return; | ||
} | ||
|
||
next(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.