Update selected item color in Pass menu
[ProtonMail-WebClient.git] / packages / pass / store / sagas / vaults / vault-edit.saga.ts
blobc82cb0132b259f88672348f21b43ce8bf66d830b
1 import { put, takeEvery } from 'redux-saga/effects';
3 import { editVault } from '@proton/pass/lib/vaults/vault.requests';
4 import { vaultEditFailure, vaultEditIntent, vaultEditSuccess } from '@proton/pass/store/actions';
5 import type { ShareType } from '@proton/pass/types';
6 import { type Share } from '@proton/pass/types';
8 function* editVaultWorker({ payload, meta }: ReturnType<typeof vaultEditIntent>) {
9     try {
10         const share: Share<ShareType.Vault> = yield editVault(payload.shareId, payload.content);
11         yield put(vaultEditSuccess(meta.request.id, { share }));
12     } catch (e) {
13         yield put(vaultEditFailure(meta.request.id, payload, e));
14     }
17 export default function* watcher() {
18     yield takeEvery(vaultEditIntent.match, editVaultWorker);