refactor: update roleTypeMap type definition for improved clarity

This commit is contained in:
wxg0103 2025-07-11 20:45:23 +08:00
parent 2bda87b5a7
commit 0f4ebc5981

View File

@ -3,7 +3,7 @@ import {t} from '@/locales'
import useStore from '@/stores'
const {user} = useStore()
export const roleTypeMap: Record<RoleTypeEnum, string> = {
export const roleTypeMap: { [RoleTypeEnum.USER]: string; [RoleTypeEnum.WORKSPACE_MANAGE]: string } = {
...(user.is_admin()
? {
[RoleTypeEnum.ADMIN]: t('views.role.systemAdmin'),