Add Movement !
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
ICircuit, IMyCircuit,
|
||||
IFriends, IMsgGlobParam,
|
||||
ISigninOptions,
|
||||
ISignupOptions, IUserFields, IUserNotifType, IUserProfile, IUserState,
|
||||
ISignupOptions, IUserFields, IUserNotifType, IUserProfile, IUserState, IAccount,
|
||||
} from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import translate from '@src/globalroutines/util'
|
||||
@@ -68,6 +68,7 @@ export const DefaultUser: IUserFields = {
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
manage_mycircuits: [],
|
||||
useraccounts: [],
|
||||
},
|
||||
cart: {
|
||||
userId: '',
|
||||
@@ -125,6 +126,7 @@ export const DefaultProfile: IUserProfile = {
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
manage_mycircuits: [],
|
||||
useraccounts: [],
|
||||
}
|
||||
|
||||
export const useUserStore = defineStore('UserStore', {
|
||||
@@ -305,6 +307,16 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
IsMyCircuitByUser(user: IUserFields): any[] {
|
||||
|
||||
return tools.getCommon(this.my.profile.mycircuits, user.profile.mycircuits, 'circuitname')
|
||||
},
|
||||
|
||||
|
||||
getAccountByCircuitName(circuitname: string): any {
|
||||
return this.my.profile.useraccounts.find((rec: IAccount) => rec.circuit.name === circuitname)
|
||||
},
|
||||
|
||||
IsRefusedCircuitByName(circuitname: string): boolean {
|
||||
if (this.my.profile.refused_circuits)
|
||||
return this.my.profile.refused_circuits.findIndex((rec: ICircuit) => rec.name === circuitname) >= 0
|
||||
@@ -1210,8 +1222,8 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async setCircuitCmd($q: any, t: any, usernameOrig: string, circuitname: string, cmd: number, value: any) {
|
||||
return Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, circuitname, cmd, value })
|
||||
async setCircuitCmd($q: any, t: any, usernameOrig: string, circuitname: string, cmd: number, value: any, extrarec?: any) {
|
||||
return Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, circuitname, cmd, value, extrarec })
|
||||
.then((res) => {
|
||||
this.updateTables = true
|
||||
return res.data
|
||||
|
||||
Reference in New Issue
Block a user