diff --git a/admin/src/graphql/confirmPendingCreation.js b/admin/src/graphql/confirmPendingCreation.js index 29ac5b4fc..df72cc04d 100644 --- a/admin/src/graphql/confirmPendingCreation.js +++ b/admin/src/graphql/confirmPendingCreation.js @@ -1,7 +1,7 @@ import gql from 'graphql-tag' export const confirmPendingCreation = gql` - mutation ($id: Float!) { + mutation ($id: Int!) { confirmPendingCreation(id: $id) } ` diff --git a/admin/src/graphql/deletePendingCreation.js b/admin/src/graphql/deletePendingCreation.js index e47fa6a8d..edf45fe74 100644 --- a/admin/src/graphql/deletePendingCreation.js +++ b/admin/src/graphql/deletePendingCreation.js @@ -1,7 +1,7 @@ import gql from 'graphql-tag' export const deletePendingCreation = gql` - mutation ($id: Float!) { + mutation ($id: Int!) { deletePendingCreation(id: $id) } ` diff --git a/admin/src/graphql/deleteUser.js b/admin/src/graphql/deleteUser.js index 3b9bc73b2..9e3606bd7 100644 --- a/admin/src/graphql/deleteUser.js +++ b/admin/src/graphql/deleteUser.js @@ -1,7 +1,7 @@ import gql from 'graphql-tag' export const deleteUser = gql` - mutation ($userId: Float!) { + mutation ($userId: Int!) { deleteUser(userId: $userId) } ` diff --git a/admin/src/graphql/unDeleteUser.js b/admin/src/graphql/unDeleteUser.js index 2c6d603b2..b48c8981f 100644 --- a/admin/src/graphql/unDeleteUser.js +++ b/admin/src/graphql/unDeleteUser.js @@ -1,7 +1,7 @@ import gql from 'graphql-tag' export const unDeleteUser = gql` - mutation ($userId: Float!) { + mutation ($userId: Int!) { unDeleteUser(userId: $userId) } ` diff --git a/admin/src/pages/UserSearch.vue b/admin/src/pages/UserSearch.vue index 1fe44eda7..24334e0c9 100644 --- a/admin/src/pages/UserSearch.vue +++ b/admin/src/pages/UserSearch.vue @@ -99,7 +99,7 @@ export default { }, updateDeletedAt(userId, deletedAt) { this.searchResult.find((obj) => obj.userId === userId).deletedAt = deletedAt - this.toastSuccess(this.$t('user_deleted')) + this.toastSuccess(deletedAt ? this.$t('user_deleted') : this.$t('user_recovered')) }, }, watch: { diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 4c902496d..d98b38b7f 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -127,7 +127,10 @@ export class AdminResolver { @Authorized([RIGHTS.DELETE_USER]) @Mutation(() => Date, { nullable: true }) - async deleteUser(@Arg('userId') userId: number, @Ctx() context: any): Promise { + async deleteUser( + @Arg('userId', () => Int) userId: number, + @Ctx() context: any, + ): Promise { const user = await dbUser.findOne({ id: userId }) // user exists ? if (!user) { @@ -146,7 +149,7 @@ export class AdminResolver { @Authorized([RIGHTS.UNDELETE_USER]) @Mutation(() => Date, { nullable: true }) - async unDeleteUser(@Arg('userId') userId: number): Promise { + async unDeleteUser(@Arg('userId', () => Int) userId: number): Promise { const user = await dbUser.findOne({ id: userId }, { withDeleted: true }) // user exists ? if (!user) { @@ -288,7 +291,7 @@ export class AdminResolver { @Authorized([RIGHTS.DELETE_PENDING_CREATION]) @Mutation(() => Boolean) - async deletePendingCreation(@Arg('id') id: number): Promise { + async deletePendingCreation(@Arg('id', () => Int) id: number): Promise { const entity = await AdminPendingCreation.findOneOrFail(id) const res = await AdminPendingCreation.delete(entity) return !!res @@ -296,7 +299,10 @@ export class AdminResolver { @Authorized([RIGHTS.CONFIRM_PENDING_CREATION]) @Mutation(() => Boolean) - async confirmPendingCreation(@Arg('id') id: number, @Ctx() context: any): Promise { + async confirmPendingCreation( + @Arg('id', () => Int) id: number, + @Ctx() context: any, + ): Promise { const pendingCreation = await AdminPendingCreation.findOneOrFail(id) const moderatorUser = context.user if (moderatorUser.id === pendingCreation.userId) diff --git a/backend/src/seeds/graphql/mutations.ts b/backend/src/seeds/graphql/mutations.ts index 19ca2a8d0..f68d983c0 100644 --- a/backend/src/seeds/graphql/mutations.ts +++ b/backend/src/seeds/graphql/mutations.ts @@ -94,7 +94,7 @@ export const createPendingCreation = gql` ` export const confirmPendingCreation = gql` - mutation ($id: Float!) { + mutation ($id: Int!) { confirmPendingCreation(id: $id) } ` diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 590a56f74..79532cb21 100755 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -42,10 +42,6 @@ -
- {{ $t('gdd_per_link.redeem') + ':' }} - {{ $route.params.code }} -
@@ -68,7 +64,6 @@ import InputPassword from '@/components/Inputs/InputPassword' import InputEmail from '@/components/Inputs/InputEmail' import { login } from '@/graphql/queries' import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo' -import { redeemTransactionLink } from '@/graphql/mutations' export default { name: 'Login', @@ -101,16 +96,17 @@ export default { }, fetchPolicy: 'network-only', }) - .then((result) => { + .then(async (result) => { const { data: { login }, } = result this.$store.dispatch('login', login) + await loader.hide() if (this.$route.params.code) { - this.redeemLink(this.$route.params.code) + this.$router.push(`/redeem/${this.$route.params.code}`) + } else { + this.$router.push('/overview') } - this.$router.push('/overview') - loader.hide() }) .catch((error) => { this.toastError(this.$t('error.no-account')) @@ -122,21 +118,6 @@ export default { loader.hide() }) }, - redeemLink(code) { - this.$apollo - .mutate({ - mutation: redeemTransactionLink, - variables: { - code: code, - }, - }) - .then(() => { - this.toastSuccess(this.$t('gdd_per_link.successfully-redeemed')) - }) - .catch((err) => { - this.toastError(err.message) - }) - }, }, } diff --git a/frontend/src/pages/Register.vue b/frontend/src/pages/Register.vue index 9fb3db56e..152c18198 100755 --- a/frontend/src/pages/Register.vue +++ b/frontend/src/pages/Register.vue @@ -118,24 +118,6 @@ {{ messageError }} - - - -
- - - - - - -
-
-