perf: mute the fetch roles request (#857)

#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

静默请求所有角色信息,用于显示 displayName。(临时解决方案)

#### Does this PR introduce a user-facing change?


```release-note
None
```
pull/854/head^2
Ryan Wang 2023-02-15 17:08:11 +08:00 committed by GitHub
parent aca67f683c
commit fe353a472f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -14,11 +14,14 @@ export const useRoleStore = defineStore("role", () => {
async function fetchRoles() { async function fetchRoles() {
try { try {
const { data } = await apiClient.extension.role.listv1alpha1Role({ const { data } = await apiClient.extension.role.listv1alpha1Role(
page: 0, {
size: 0, page: 0,
labelSelector: [`!${roleLabels.TEMPLATE}`], size: 0,
}); labelSelector: [`!${roleLabels.TEMPLATE}`],
},
{ mute: true }
);
roles.value = data.items; roles.value = data.items;
} catch (error) { } catch (error) {
console.error("Failed to fetch roles", error); console.error("Failed to fetch roles", error);