Skip to content

Commit

Permalink
fix: always using bulk insert
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugma committed Jan 28, 2025
1 parent 088f22d commit c29a9fa
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/components/Modal/GroupMemberAddModal/GroupMemberAddModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,10 @@ const add = async () => {
isAdding.value = true
const reqIds = Array.from(userIds.value)

Check warning on line 54 in src/components/Modal/GroupMemberAddModal/GroupMemberAddModal.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Modal/GroupMemberAddModal/GroupMemberAddModal.vue#L54

Added line #L54 was not covered by tests
try {
if (reqIds.length === 1 && reqIds[0]) {
const userId = reqIds[0]
await apis.addUserGroupMember(props.id, {
id: userId,
role: role.value
})
} else {
await apis.addUserGroupMember(
props.id,
reqIds.map(id => ({ id, role: role.value }))
)
}
await apis.addUserGroupMember(
props.id,
reqIds.map(id => ({ id, role: role.value }))
)

Check warning on line 59 in src/components/Modal/GroupMemberAddModal/GroupMemberAddModal.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Modal/GroupMemberAddModal/GroupMemberAddModal.vue#L56-L59

Added lines #L56 - L59 were not covered by tests
} catch {
addErrorToast('グループメンバーの追加に失敗しました')
}
Expand Down

0 comments on commit c29a9fa

Please sign in to comment.