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

Commit 0a65f5b

Browse files
authored
perf: hide anonymousUser in user filter dropdown list (#891)
#### 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 ```
1 parent 3d718b5 commit 0a65f5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/system/users/composables/use-user.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ export function useUserFetch(options?: {
1717
const users = ref<User[]>([] as User[]);
1818
const loading = ref(false);
1919

20+
const ANONYMOUSUSER_NAME = "anonymousUser";
21+
2022
const handleFetchUsers = async () => {
2123
try {
2224
loading.value = true;
23-
const { data } = await apiClient.extension.user.listv1alpha1User();
25+
const { data } = await apiClient.extension.user.listv1alpha1User({
26+
fieldSelector: [`name!=${ANONYMOUSUSER_NAME}`],
27+
});
2428
users.value = data.items;
2529
} catch (e) {
2630
console.error("Failed to fetch users", e);

0 commit comments

Comments
 (0)