Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / pass / store / sagas / invites / new-user-invite-remove.saga.ts
blob3db8fa08ba9b1a23d935984f9340070de9291bab
1 import { put, takeEvery } from 'redux-saga/effects';
3 import { removeNewUserInvite } from '@proton/pass/lib/invites/invite.requests';
4 import {
5     newUserInviteRemoveFailure,
6     newUserInviteRemoveIntent,
7     newUserInviteRemoveSuccess,
8 } from '@proton/pass/store/actions';
10 function* removeInviteWorker({ payload, meta: { request } }: ReturnType<typeof newUserInviteRemoveIntent>) {
11     try {
12         yield removeNewUserInvite(payload);
13         yield put(newUserInviteRemoveSuccess(request.id, payload.shareId, payload.newUserInviteId));
14     } catch (err) {
15         yield put(newUserInviteRemoveFailure(request.id, err));
16     }
19 export default function* watcher() {
20     yield takeEvery(newUserInviteRemoveIntent.match, removeInviteWorker);