Skip to content

Commit

Permalink
perf: mute the fetch roles request (halo-dev/console#857)
Browse files Browse the repository at this point in the history
#### 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
```
  • Loading branch information
ruibaby authored Feb 15, 2023
1 parent fce581b commit e9970b2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/stores/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ export const useRoleStore = defineStore("role", () => {

async function fetchRoles() {
try {
const { data } = await apiClient.extension.role.listv1alpha1Role({
page: 0,
size: 0,
labelSelector: [`!${roleLabels.TEMPLATE}`],
});
const { data } = await apiClient.extension.role.listv1alpha1Role(
{
page: 0,
size: 0,
labelSelector: [`!${roleLabels.TEMPLATE}`],
},
{ mute: true }
);
roles.value = data.items;
} catch (error) {
console.error("Failed to fetch roles", error);
Expand Down

0 comments on commit e9970b2

Please sign in to comment.