From 74ff3b5265c270eadcf0b960ab317a73051db4b6 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sun, 20 Jun 2021 21:17:05 -0500 Subject: [PATCH] Clean up store --- services/webui/src/app/store/actions.ts | 22 ++++++++++++++++------ services/webui/src/app/store/mutations.ts | 2 +- services/webui/src/app/store/state.ts | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/services/webui/src/app/store/actions.ts b/services/webui/src/app/store/actions.ts index 138e37d..5742101 100644 --- a/services/webui/src/app/store/actions.ts +++ b/services/webui/src/app/store/actions.ts @@ -31,6 +31,7 @@ export enum Action { AuthLogin = "AUTH_LOGIN", AuthForget = "AUHT_FORGET", AuthLoad = "AUTH_LOAD", + AuthVerify = "AUTH_VERIFY", // Movies Methods ActiveMovieRequests = "ACTIVE_MOVIE_REQUESTS", @@ -45,6 +46,7 @@ export enum Action { */ export type ActionsTypes = { // RESTful Generics + // @TODO These shouldn't be actions as they pollute the logs [Action.Fetch] : (payload: IGetPayload) => Promise, [Action.Get] : (payload: IGetPayload) => Promise, [Action.Post] : (payload: IPostPayload) => Promise, @@ -55,7 +57,8 @@ export type ActionsTypes = { [Action.AuthRegister]: (payload: IRegisterPayload) => Promise, [Action.AuthLogin] : (payload: ILoginPayload) => Promise, [Action.AuthForget] : () => void, - [Action.AuthLoad] : () => boolean, + [Action.AuthLoad] : () => void, + [Action.AuthVerify] : () => void, // Movie Methods [Action.ActiveMovieRequests]: () => Promise<[number, IApiDataResponse]>, @@ -184,7 +187,7 @@ export const actions: Actions = { name : user.name, isAdmin: user.isAdmin, token : token - } + }; } catch(e) { return false; } diff --git a/services/webui/src/app/store/state.ts b/services/webui/src/app/store/state.ts index f4efad0..a809a08 100644 --- a/services/webui/src/app/store/state.ts +++ b/services/webui/src/app/store/state.ts @@ -6,7 +6,7 @@ import Modal from "../components/modals"; * The state definition */ export interface IState { - movies : { + movies: { [tmdbId: string]: { refCount: number, movie: IMovie