Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Set default topic in roadmapController
Browse files Browse the repository at this point in the history
Made 'PROGRAMMING' the default topic if an invalid topic is provided. This step provides a fallback mechanism which prevents route failure due to any potential input error related to the 'topic' key..
  • Loading branch information
sopyb committed Sep 12, 2023
1 parent b3e8f66 commit d0911e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/roadmapController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function createRoadmap(req: RequestWithBody, res: Response) {
const db = new Database();

if (!topic || !Object.values(RoadmapTopic).includes(topic as RoadmapTopic))
topic = null;
topic = RoadmapTopic.PROGRAMMING;

isPublic = true;
if (isDraft !== true && isDraft !== false) isDraft = false;
Expand Down

0 comments on commit d0911e9

Please sign in to comment.