Add hideAmountGDD and hideAmountGDT to the login mutations and the verifyLogin queries

This commit is contained in:
elweyn 2023-01-03 12:24:49 +01:00
parent e936e2bf40
commit 2010a1b059
4 changed files with 28 additions and 0 deletions

View File

@ -27,6 +27,8 @@ export class User {
this.klickTipp = null
this.hasElopage = null
this.creation = creation
this.hideAmountGDD = user.hideAmountGDD
this.hideAmountGDT = user.hideAmountGDT
}
@Field(() => Number)
@ -72,6 +74,12 @@ export class User {
@Field(() => String)
language: string
@Field(() => Boolean)
hideAmountGDD: boolean
@Field(() => Boolean)
hideAmountGDT: boolean
// This is not the users publisherId, but the one of the users who recommend him
@Field(() => Number, { nullable: true })
publisherId: number | null

View File

@ -31,6 +31,8 @@ export const updateUserInfos = gql`
$password: String
$passwordNew: String
$locale: String
$hideAmountGDD: boolean!
$hideAmountGDT: boolean!
) {
updateUserInfos(
firstName: $firstName
@ -38,6 +40,8 @@ export const updateUserInfos = gql`
password: $password
passwordNew: $passwordNew
language: $locale
hideAmountGDD: $hideAmountGDD
hideAmountGDT: $hideAmountGDT
)
}
`
@ -151,6 +155,8 @@ export const login = gql`
publisherId
isAdmin
creation
hideAmountGDD
hideAmountGDT
}
}
`

View File

@ -14,6 +14,8 @@ export const verifyLogin = gql`
publisherId
isAdmin
creation
hideAmountGDD
hideAmountGDT
}
}
`

View File

@ -50,6 +50,12 @@ export const mutations = {
creation: (state, creation) => {
state.creation = creation
},
hideAmountGDD: (state, hideAmountGDD) => {
state.hideAmountGDD = hideAmountGDD
},
hideAmountGDT: (state, hideAmountGDT) => {
state.hideAmountGDT = hideAmountGDT
},
}
export const actions = {
@ -64,6 +70,8 @@ export const actions = {
commit('publisherId', data.publisherId)
commit('isAdmin', data.isAdmin)
commit('creation', data.creation)
commit('hideAmountGDD', data.hideAmountGDD)
commit('hideAmountGDT', data.hideAmountGDT)
},
logout: ({ commit, state }) => {
commit('token', null)
@ -76,6 +84,8 @@ export const actions = {
commit('publisherId', null)
commit('isAdmin', false)
commit('creation', null)
commit('hideAmountGDD', null)
commit('hideAmountGDT', null)
localStorage.clear()
},
}
@ -102,6 +112,8 @@ try {
hasElopage: false,
publisherId: null,
creation: null,
hideAmountGDD: null,
hideAmountGDT: null,
},
getters: {},
// Syncronous mutation of the state