Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const updateSpeakerToTalk = async (action, store) => {
const { uid, talkId } = action.payload
const talk = store.data.talks.get(talkId)
if (talk) {
let updated
if (action.type === '@@ui/ADD_SPEAKER_TO_TALK') {
updated = set(talk, `speakers.${uid}`, true)
} else if (action.type === '@@ui/REMOVE_SPEAKER_TO_TALK') {
updated = unset(talk, `speakers.${uid}`)
}
if (updated && Object.keys(updated.speakers).length > 0) {
await talkCrud.update(updated)
store.data.talks.update(updated)
}
}
}
export const removeMember = async (action, store, { router }) => {
const { uid, organizationId } = action.payload
const organization = store.data.organizations.get(organizationId)
const updated = unset(organization, `members.${uid}`)
await organizationCrud.update(updated)
store.data.organizations.update(updated)
router.push('organizer-organization-page', { organizationId })
}