remaining backend interactor removals

This commit is contained in:
Henry Jameson 2026-06-15 20:02:22 +03:00
commit 0d9709825f
45 changed files with 1118 additions and 856 deletions

View file

@ -1,28 +1,37 @@
import { get, set } from 'lodash'
import { useCredentialsStore } from 'src/stores/credentials.js'
import {
updateNotificationSettings,
updateProfile,
} from 'src/services/api/api.service.js'
const defaultApi = ({ rootState, commit }, { path, value }) => {
const params = {}
set(params, path, value)
return rootState.api.backendInteractor
.updateProfile({ params })
.then((result) => {
commit('addNewUsers', [result])
commit('setCurrentUser', result)
})
return updateProfile({
params,
credentials: useCredentialsStore().current,
}).then((result) => {
commit('addNewUsers', [result])
commit('setCurrentUser', result)
})
}
const notificationsApi = ({ rootState, commit }, { path, value, oldValue }) => {
const settings = {}
set(settings, path, value)
return rootState.api.backendInteractor
.updateNotificationSettings({ settings })
.then((result) => {
if (result.status === 'success') {
commit('confirmProfileOption', { name, value })
} else {
commit('confirmProfileOption', { name, value: oldValue })
}
})
return updateNotificationSettings({
settings,
credentials: useCredentialsStore().current,
}).then((result) => {
if (result.status === 'success') {
commit('confirmProfileOption', { name, value })
} else {
commit('confirmProfileOption', { name, value: oldValue })
}
})
}
/**