perf: mute the fetch roles request (halo-dev/console#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/3445/head
Ryan Wang 2023-02-15 17:08:11 +08:00 committed by GitHub
parent fce581bd2d
commit e9970b203a
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, page: 0,
size: 0, size: 0,
labelSelector: [`!${roleLabels.TEMPLATE}`], 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);