Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
perf: hide anonymousUser in user filter dropdown list (#891)
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:

在用户条件筛选框中隐藏匿名用户。

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#3407

#### Screenshots:

<img width="864" alt="image" src="https://user-images.githubusercontent.com/21301288/221490795-eaf9c515-e487-4d76-87dd-f0010415360e.png">

#### Special notes for your reviewer:

None

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

```release-note
None
```
  • Loading branch information
ruibaby authored Feb 28, 2023
1 parent 3d718b5 commit 0a65f5b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/system/users/composables/use-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ export function useUserFetch(options?: {
const users = ref<User[]>([] as User[]);
const loading = ref(false);

const ANONYMOUSUSER_NAME = "anonymousUser";

const handleFetchUsers = async () => {
try {
loading.value = true;
const { data } = await apiClient.extension.user.listv1alpha1User();
const { data } = await apiClient.extension.user.listv1alpha1User({
fieldSelector: [`name!=${ANONYMOUSUSER_NAME}`],
});
users.value = data.items;
} catch (e) {
console.error("Failed to fetch users", e);
Expand Down

1 comment on commit 0a65f5b

@vercel
Copy link

@vercel vercel bot commented on 0a65f5b Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

halo-admin-ui.vercel.app
ui-halo-dev.vercel.app
ui-git-main-halo-dev.vercel.app

Please sign in to comment.