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>) {
10 const share: Share<ShareType.Vault> = yield editVault(payload.shareId, payload.content);
11 yield put(vaultEditSuccess(meta.request.id, { share }));
13 yield put(vaultEditFailure(meta.request.id, payload, e));
17 export default function* watcher() {
18 yield takeEvery(vaultEditIntent.match, editVaultWorker);