update vuex
This commit is contained in:
1 parent
f1d9fc3778
commit
9c69e96416
3 files changed
+69
-3
No files matched your search
+7
-3
@@ -1,21 +1,25 @@
|
||||
import { IApplication } from '@/operators';
|
||||
import { Module } from 'vuex';
|
||||
import { IChatState } from './models';
|
||||
import { IChatState, Status } from './models';
|
||||
|
||||
export const chat: Module<IChatState, any> = {
|
||||
namespaced: true,
|
||||
state(): IChatState {
|
||||
return {
|
||||
applications: undefined
|
||||
applications: undefined,
|
||||
applicationsStatus: undefined
|
||||
};
|
||||
},
|
||||
mutations: {
|
||||
setApplications(state: IChatState, payload: IApplication[]): void {
|
||||
state.applications = payload;
|
||||
},
|
||||
setApplicationsStatus(state: IChatState, payload: Status): void {
|
||||
state.applicationsStatus = payload;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setApplications({ commit }: any, payload: IApplication[]) {
|
||||
async setApplications({ commit }: any, payload: IApplication[]) {
|
||||
commit('setApplications', payload);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { IApplication, IMidjourneyPreset, IUser } from '@/operators';
|
||||
|
||||
export enum Status {
|
||||
Request = 'Request',
|
||||
Success = 'Success',
|
||||
Error = 'Error'
|
||||
}
|
||||
|
||||
export interface IToken {
|
||||
access?: string;
|
||||
refresh?: string;
|
||||
@@ -24,6 +30,7 @@ export interface IMidjourneyState {
|
||||
|
||||
export interface IChatState {
|
||||
applications: IApplication[] | undefined;
|
||||
applicationsStatus: Status | undefined;
|
||||
}
|
||||
|
||||
export interface IRootState {
|
||||
|
||||
Reference in new issue
Block a user