Refactor/upgrade backend and frontend parts (#2)

* ♻️ 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
This commit is contained in:
Sebastián Ramírez
2019-03-11 13:36:42 +04:00
committed by GitHub
parent 9e0b826618
commit cd112bd683
54 changed files with 492 additions and 371 deletions

View File

@@ -1,13 +1,12 @@
import { api } from '@/api';
import { ActionContext } from 'vuex';
import {
commitSetUsers,
commitSetUser,
} from './accessors/commit';
import { IUserProfileCreate, IUserProfileUpdate } from '@/interfaces';
import { State } from '../state';
import { AdminState } from './state';
import { dispatchCheckApiError, commitAddNotification, commitRemoveNotification } from '../main/accessors';
import { getStoreAccessors } from 'typesafe-vuex';
import { commitSetUsers, commitSetUser } from './mutations';
import { dispatchCheckApiError } from '../main/actions';
import { commitAddNotification, commitRemoveNotification } from '../main/mutations';
type MainContext = ActionContext<AdminState, State>;
@@ -32,7 +31,7 @@ export const actions = {
]))[0];
commitSetUser(context, response.data);
commitRemoveNotification(context, loadingNotification);
commitAddNotification(context, {content: 'User successfully updated', color: 'success'});
commitAddNotification(context, { content: 'User successfully updated', color: 'success' });
} catch (error) {
await dispatchCheckApiError(context, error);
}
@@ -53,3 +52,9 @@ export const actions = {
}
},
};
const { dispatch } = getStoreAccessors<AdminState, State>('');
export const dispatchCreateUser = dispatch(actions.actionCreateUser);
export const dispatchGetUsers = dispatch(actions.actionGetUsers);
export const dispatchUpdateUser = dispatch(actions.actionUpdateUser);