|
@@ -89,7 +89,11 @@ export const useProject = defineStore('project', {
|
|
|
},
|
|
|
actions: {
|
|
|
async setRoles(id: Project['projectId']) {
|
|
|
- this.roleMenus = transformNames(await fetchProjectRoleOptions(id))
|
|
|
+ if (id) {
|
|
|
+ this.roleMenus = transformNames(await fetchProjectRoleOptions(id))
|
|
|
+ } else {
|
|
|
+ this.roleMenus = DefaultMenus
|
|
|
+ }
|
|
|
},
|
|
|
async setCurrent(id: Project['projectId']) {
|
|
|
this.current = await fetchProject(id)
|