diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index f116c3968..e7e8c2026 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Resolver, Query, Arg, Args, Authorized, Mutation, Ctx } from 'type-graphql' +import { Resolver, Query, Arg, Args, Authorized, Mutation, Ctx, Int } from 'type-graphql' import { getCustomRepository, IsNull, @@ -122,7 +122,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 User.findOne({ id: userId }) // user exists ? if (!user) { @@ -142,7 +145,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 User.findOne({ id: userId }, { withDeleted: true }) // user exists ? if (!user) { @@ -284,7 +287,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 @@ -292,7 +295,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 userRepository = getCustomRepository(UserRepository) const moderatorUser = await userRepository.findByPubkeyHex(context.pubKey) diff --git a/backend/src/server/plugins.ts b/backend/src/server/plugins.ts index a407135ea..5902a415f 100644 --- a/backend/src/server/plugins.ts +++ b/backend/src/server/plugins.ts @@ -39,7 +39,6 @@ const apolloLogPlugin = ApolloLogPlugin({ }, }) -const plugins = - process.env.NODE_ENV === 'development' ? [setHeadersPlugin] : [setHeadersPlugin, apolloLogPlugin] +const plugins = process.env.NODE_ENV === 'development' ? [setHeadersPlugin] : [setHeadersPlugin] // , apolloLogPlugin export default plugins