1 import { put } from 'redux-saga/effects';
3 import { setMonitorSettings } from '@proton/pass/lib/monitor/monitor.request';
4 import { getBreaches, monitorToggle } from '@proton/pass/store/actions';
5 import { withRevalidate } from '@proton/pass/store/request/enhancers';
6 import { createRequestSaga } from '@proton/pass/store/request/sagas';
7 import type { UpdateUserMonitorStateRequest } from '@proton/pass/types';
9 export default createRequestSaga({
10 actions: monitorToggle,
11 call: function* (data) {
12 const res: UpdateUserMonitorStateRequest = yield setMonitorSettings(data);
13 yield put(withRevalidate(getBreaches.intent()));