Update selected item color in Pass menu
[ProtonMail-WebClient.git] / packages / pass / store / sagas / items / item-unpin.saga.ts
blob5788c223ddf0089eca109088373d2a6fd5eca0f2
1 import { put, takeEvery } from 'redux-saga/effects';
3 import { unpinItem } from '@proton/pass/lib/items/item.requests';
4 import { itemUnpinFailure, itemUnpinIntent, itemUnpinSuccess } from '@proton/pass/store/actions';
6 function* itemUnpinWorker({ payload, meta: { request } }: ReturnType<typeof itemUnpinIntent>) {
7     try {
8         yield unpinItem(payload.shareId, payload.itemId);
9         yield put(itemUnpinSuccess(request.id, payload));
10     } catch (err) {
11         yield put(itemUnpinFailure(request.id, err));
12     }
15 export default function* watcher() {
16     yield takeEvery(itemUnpinIntent.match, itemUnpinWorker);