From a0eeec4e187a5aca75cac8e7b1fe76b303883a02 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Thu, 6 Feb 2020 15:14:35 +0100 Subject: [PATCH] Add extra fields to registration, remove unused fields --- .../gql/local/mutations/helloEmail.gql | 3 + client/src/graphql/resolvers.js | 4 +- client/src/main.js | 3 +- client/src/pages/hello.vue | 4 +- client/src/pages/login.vue | 129 ++++++++------- client/src/pages/registration.vue | 147 +++++++----------- 6 files changed, 128 insertions(+), 162 deletions(-) create mode 100644 client/src/graphql/gql/local/mutations/helloEmail.gql diff --git a/client/src/graphql/gql/local/mutations/helloEmail.gql b/client/src/graphql/gql/local/mutations/helloEmail.gql new file mode 100644 index 00000000..b171cb1b --- /dev/null +++ b/client/src/graphql/gql/local/mutations/helloEmail.gql @@ -0,0 +1,3 @@ +mutation($helloEmail: String!) { + helloEmail(email: $helloEmail) @client +} diff --git a/client/src/graphql/resolvers.js b/client/src/graphql/resolvers.js index ae68098a..27a60133 100644 --- a/client/src/graphql/resolvers.js +++ b/client/src/graphql/resolvers.js @@ -9,9 +9,9 @@ export const resolvers = { cache.writeQuery({query: SCROLL_POSITION, data}); return data.scrollPosition; }, - helloEmail: (_, {helloEmail}, {cache}) => { + helloEmail: (_, {email}, {cache}) => { const data = cache.readQuery({query: HELLO_EMAIL}); - data.helloEmail.helloEmail = helloEmail; + data.helloEmail.email = email; cache.writeQuery({query: HELLO_EMAIL, data}); return data.helloEmail; }, diff --git a/client/src/main.js b/client/src/main.js index 89f42ff4..8cc587f5 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -11,7 +11,7 @@ import store from '@/store/index' import VueScrollTo from 'vue-scrollto'; import VueAnalytics from 'vue-analytics'; import {Validator, install as VeeValidate} from 'vee-validate/dist/vee-validate.minimal.esm.js'; -import {required, min, decimal} from 'vee-validate/dist/rules.esm.js'; +import {required, min, decimal, confirmed} from 'vee-validate/dist/rules.esm.js'; import veeDe from 'vee-validate/dist/locale/de'; import {dateFilter} from './filters/date-filter'; import autoGrow from '@/directives/auto-grow' @@ -77,6 +77,7 @@ const apolloProvider = new VueApollo({ Validator.extend('required', required); Validator.extend('min', min); Validator.extend('decimal', decimal); +Validator.extend('confirmed', confirmed); const dict = { custom: { diff --git a/client/src/pages/hello.vue b/client/src/pages/hello.vue index 29fdabe3..3af0ac67 100644 --- a/client/src/pages/hello.vue +++ b/client/src/pages/hello.vue @@ -39,7 +39,7 @@ diff --git a/client/src/pages/registration.vue b/client/src/pages/registration.vue index 08f71c22..6ce40fb8 100644 --- a/client/src/pages/registration.vue +++ b/client/src/pages/registration.vue @@ -1,8 +1,12 @@ @@ -193,6 +167,7 @@