mirror of
https://github.com/kevin-DL/full-stack-fastapi-postgresql.git
synced 2026-01-14 11:04:41 +00:00
* ♻️ Refactor and simplify backend code * ♻️ Refactor frontend state, integrate typesafe-vuex accessors into state files * ♻️ Use new state accessors and standardize layout * 🔒 Upgrade and fix npm security audit * 🔧 Update local re-generation scripts * 🔊 Log startup exceptions to detect errors early * ✏️ Fix password reset token content * 🔥 Remove unneeded Dockerfile directives * 🔥 Remove unnecessary print * 🔥 Remove unnecessary code, upgrade dependencies in backend * ✏️ Fix typos in docstrings and comments * 🏗️ Improve user Depends utilities to simplify and remove code * 🔥 Remove deprecated SQLAlchemy parameter
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import { IUserProfile } from '@/interfaces';
|
|
import { MainState, AppNotification } from './state';
|
|
import { getStoreAccessors } from 'typesafe-vuex';
|
|
import { State } from '../state';
|
|
|
|
|
|
export const mutations = {
|
|
setToken(state: MainState, payload: string) {
|
|
state.token = payload;
|
|
},
|
|
setLoggedIn(state: MainState, payload: boolean) {
|
|
state.isLoggedIn = payload;
|
|
},
|
|
setLogInError(state: MainState, payload: boolean) {
|
|
state.logInError = payload;
|
|
},
|
|
setUserProfile(state: MainState, payload: IUserProfile) {
|
|
state.userProfile = payload;
|
|
},
|
|
setDashboardMiniDrawer(state: MainState, payload: boolean) {
|
|
state.dashboardMiniDrawer = payload;
|
|
},
|
|
setDashboardShowDrawer(state: MainState, payload: boolean) {
|
|
state.dashboardShowDrawer = payload;
|
|
},
|
|
addNotification(state: MainState, payload: AppNotification) {
|
|
state.notifications.push(payload);
|
|
},
|
|
removeNotification(state: MainState, payload: AppNotification) {
|
|
state.notifications = state.notifications.filter((notification) => notification !== payload);
|
|
},
|
|
};
|
|
|
|
const {commit} = getStoreAccessors<MainState | any, State>('');
|
|
|
|
export const commitSetDashboardMiniDrawer = commit(mutations.setDashboardMiniDrawer);
|
|
export const commitSetDashboardShowDrawer = commit(mutations.setDashboardShowDrawer);
|
|
export const commitSetLoggedIn = commit(mutations.setLoggedIn);
|
|
export const commitSetLogInError = commit(mutations.setLogInError);
|
|
export const commitSetToken = commit(mutations.setToken);
|
|
export const commitSetUserProfile = commit(mutations.setUserProfile);
|
|
export const commitAddNotification = commit(mutations.addNotification);
|
|
export const commitRemoveNotification = commit(mutations.removeNotification);
|