-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(routing): add nav guard for project-board and group-board
- Loading branch information
1 parent
4ac9631
commit 2616b09
Showing
4 changed files
with
44 additions
and
0 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,15 @@ | ||
import { routeNames } from "@/router"; | ||
import GroupService from "@/services/GroupService.js"; | ||
|
||
export default async function groupBoardGuard(route) { | ||
const group = await GroupService.fetchGroupByID( | ||
{ | ||
cloud: { id: route.params.spaceID }, | ||
id: route.params.projectID | ||
}, | ||
route.params.groupID | ||
); | ||
if (!group) { | ||
return { name: routeNames.pageNotFound }; | ||
} | ||
} |
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,12 @@ | ||
import { routeNames } from "@/router"; | ||
import ProjectService from "@/services/ProjectService.js"; | ||
|
||
export default async function projectBoardGuard(route) { | ||
const project = await ProjectService.fetchProjectByID( | ||
{ id: route.params.spaceID }, | ||
route.params.projectID | ||
); | ||
if (!project) { | ||
return { name: routeNames.pageNotFound }; | ||
} | ||
} |
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