Files
Nexior/src/store/chat/mutations.ts
T

37 lines
951 B
TypeScript

import { IApplication, IChatConversation, IChatModel, ICredential, IService } from '@/models';
import { IChatState } from './models';
export const resetAll = (state: IChatState): void => {
state.application = undefined;
state.conversations = undefined;
};
export const setModel = (state: IChatState, payload: IChatModel): void => {
state.model = payload;
};
export const setCredential = (state: IChatState, payload: ICredential): void => {
state.credential = payload;
};
export const setApplication = (state: IChatState, payload: IApplication): void => {
state.application = payload;
};
export const setService = (state: IChatState, payload: IService): void => {
state.service = payload;
};
export const setConversations = (state: IChatState, payload: IChatConversation[]): void => {
state.conversations = payload;
};
export default {
setModel,
setService,
setCredential,
setConversations,
setApplication,
resetAll
};