diff --git a/backend/src/graphql/model/User.ts b/backend/src/graphql/model/User.ts index cc52ff1f1..6e353f6a7 100644 --- a/backend/src/graphql/model/User.ts +++ b/backend/src/graphql/model/User.ts @@ -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 diff --git a/frontend/src/graphql/mutations.js b/frontend/src/graphql/mutations.js index 3156c2861..8b0464244 100644 --- a/frontend/src/graphql/mutations.js +++ b/frontend/src/graphql/mutations.js @@ -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 } } ` diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index d261797c2..d4973146d 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -14,6 +14,8 @@ export const verifyLogin = gql` publisherId isAdmin creation + hideAmountGDD + hideAmountGDT } } ` diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 8fdbc519e..dff96ee1d 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -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