Skip to content

Commit 2143a78

Browse files
committed
remove groups from listing if not required
1 parent f12ac0d commit 2143a78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

resources/js/components/forms/album/SearchTargetUser.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const usersAndGroupsStore = useUsersAndGroupStore();
4040
4141
const props = defineProps<{
4242
filteredUsersIds?: UserOrGroupId[];
43-
withGroups?: boolean; // TODO: check me
43+
withGroups?: boolean;
4444
}>();
4545
4646
const emits = defineEmits<{
@@ -70,7 +70,8 @@ function filterUserGroups(filteredUsersIds: UserOrGroupId[] = []) {
7070
7171
options.value = usersAndGroupsStore.usersGroupsList.filter(
7272
(userGroup) =>
73-
(userGroup.type === "user" && !userIds.includes(userGroup.id)) || (userGroup.type === "group" && !groupIds.includes(userGroup.id)),
73+
(userGroup.type === "user" && !userIds.includes(userGroup.id)) ||
74+
(props.withGroups && userGroup.type === "group" && !groupIds.includes(userGroup.id)),
7475
);
7576
7677
if (options.value.length === 0 && emits !== undefined) {

0 commit comments

Comments
 (0)