Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
impl: bulk insert
Browse files Browse the repository at this point in the history
Pugma committed Jan 24, 2025

Verified

This commit was signed with the committer’s verified signature.
NikkelM Nikkel Mollenhauer
1 parent 659d226 commit 086d42c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -51,12 +51,19 @@ const role = ref('')
const isAdding = ref(false)
const add = async () => {
isAdding.value = true
const reqIds = Array.from(userIds.value)

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

Codecov / codecov/patch

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

Added line #L54 was not covered by tests
try {
for (const userId of userIds.value) {
if (reqIds.length === 1 && reqIds[0]) {
const userId = reqIds[0]

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

Codecov / codecov/patch

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

Added lines #L56 - L57 were not covered by tests
await apis.addUserGroupMember(props.id, {
id: userId,
role: role.value
})
} else {
await apis.addUserGroupMember(
props.id,
reqIds.map(id => ({ id, role: role.value }))
)

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

Codecov / codecov/patch

src/components/Modal/GroupMemberAddModal/GroupMemberAddModal.vue#L62-L66

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

0 comments on commit 086d42c

Please sign in to comment.