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