diff --git a/backend/src/app.controller.ts b/backend/src/app.controller.ts index 048def5f..9ccb6f8b 100644 --- a/backend/src/app.controller.ts +++ b/backend/src/app.controller.ts @@ -1,4 +1,4 @@ -import { Body, Controller, Get, Post, Req, Res} from '@nestjs/common'; +import { Body, Controller, Get, Post, Req, Res } from '@nestjs/common'; import { AppService } from './app.service'; import { Prisma, User } from '@prisma/client'; import { AuthService } from './auth/auth.service'; @@ -6,7 +6,11 @@ import { UserService } from './database/user/user.service'; @Controller() export class AppController { - constructor(private readonly appService: AppService, private readonly userService: UserService, private readonly authService: AuthService) { } + constructor( + private readonly appService: AppService, + private readonly userService: UserService, + private readonly authService: AuthService, + ) {} @Get() getHello(): string { @@ -25,7 +29,7 @@ export class AppController { @Post('user') async createUser(@Body() user: Prisma.UserCreateInput): Promise { - return this.userService.createUser(user); + return this.userService.createUser(user); } @Get('user') diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index f650e919..908a77c8 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -22,7 +22,7 @@ import { AuthMiddleware } from './middleware/auth/auth.middleware'; imports: [ConfigModule.forRoot()], controllers: [AppController], providers: [ - AppService, + AppService, AuthService, PrismaService, UserService, diff --git a/backend/src/database/blacklist/blacklist.service.ts b/backend/src/database/blacklist/blacklist.service.ts index 4fad8119..986ae023 100644 --- a/backend/src/database/blacklist/blacklist.service.ts +++ b/backend/src/database/blacklist/blacklist.service.ts @@ -4,23 +4,25 @@ import { PrismaService } from '../prisma.service'; @Injectable() export class BlacklistService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createBlacklistItem(data: Prisma.BlacklistCreateInput): Promise { - return this.prisma.blacklist.create({ - data, - }) - } + async createBlacklistItem( + data: Prisma.BlacklistCreateInput, + ): Promise { + return this.prisma.blacklist.create({ + data, + }); + } - async getBlacklistItem( - blacklistWhereUniqueInput: Prisma.BlacklistWhereUniqueInput, - ): Promise { - return this.prisma.blacklist.findUnique({ - where: blacklistWhereUniqueInput, - }); - } + async getBlacklistItem( + blacklistWhereUniqueInput: Prisma.BlacklistWhereUniqueInput, + ): Promise { + return this.prisma.blacklist.findUnique({ + where: blacklistWhereUniqueInput, + }); + } - async getAllBlacklistItems(): Promise { - return this.prisma.blacklist.findMany(); - } + async getAllBlacklistItems(): Promise { + return this.prisma.blacklist.findMany(); + } } diff --git a/backend/src/database/expert/expert.service.ts b/backend/src/database/expert/expert.service.ts index 3d186a56..6c4fb301 100644 --- a/backend/src/database/expert/expert.service.ts +++ b/backend/src/database/expert/expert.service.ts @@ -4,19 +4,19 @@ import { PrismaService } from '../prisma.service'; @Injectable() export class ExpertService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createExpert(data: Prisma.ExpertCreateInput): Promise { - return this.prisma.expert.create({ - data, - }) - } + async createExpert(data: Prisma.ExpertCreateInput): Promise { + return this.prisma.expert.create({ + data, + }); + } - async getExpert( - expertWhereUniqueInput: Prisma.ExpertWhereUniqueInput, - ): Promise { - return this.prisma.expert.findUnique({ - where: expertWhereUniqueInput, - }); - } + async getExpert( + expertWhereUniqueInput: Prisma.ExpertWhereUniqueInput, + ): Promise { + return this.prisma.expert.findUnique({ + where: expertWhereUniqueInput, + }); + } } diff --git a/backend/src/database/favorite/favorite.service.ts b/backend/src/database/favorite/favorite.service.ts index f445bcdb..81c85f11 100644 --- a/backend/src/database/favorite/favorite.service.ts +++ b/backend/src/database/favorite/favorite.service.ts @@ -4,19 +4,19 @@ import { PrismaService } from '../prisma.service'; @Injectable() export class FavoriteService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createFavorite(data: Prisma.FavoriteCreateInput): Promise { - return this.prisma.favorite.create({ - data, - }) - } + async createFavorite(data: Prisma.FavoriteCreateInput): Promise { + return this.prisma.favorite.create({ + data, + }); + } - async getFavorite( - favoriteWhereUniqueInput: Prisma.FavoriteWhereUniqueInput, - ): Promise { - return this.prisma.favorite.findUnique({ - where: favoriteWhereUniqueInput, - }); - } + async getFavorite( + favoriteWhereUniqueInput: Prisma.FavoriteWhereUniqueInput, + ): Promise { + return this.prisma.favorite.findUnique({ + where: favoriteWhereUniqueInput, + }); + } } diff --git a/backend/src/database/login-attempt/login-attempt.service.ts b/backend/src/database/login-attempt/login-attempt.service.ts index eb30585e..970a0353 100644 --- a/backend/src/database/login-attempt/login-attempt.service.ts +++ b/backend/src/database/login-attempt/login-attempt.service.ts @@ -4,19 +4,21 @@ import { LoginAttempt, Prisma } from '@prisma/client'; @Injectable() export class LoginAttemptService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createLoginAttempt(data: Prisma.LoginAttemptCreateInput): Promise { - return this.prisma.loginAttempt.create({ - data, - }) - } + async createLoginAttempt( + data: Prisma.LoginAttemptCreateInput, + ): Promise { + return this.prisma.loginAttempt.create({ + data, + }); + } - async getLoginAttempt( - loginAttemptWhereUniqueInput: Prisma.LoginAttemptWhereUniqueInput, - ): Promise { - return this.prisma.loginAttempt.findUnique({ - where: loginAttemptWhereUniqueInput, - }); - } + async getLoginAttempt( + loginAttemptWhereUniqueInput: Prisma.LoginAttemptWhereUniqueInput, + ): Promise { + return this.prisma.loginAttempt.findUnique({ + where: loginAttemptWhereUniqueInput, + }); + } } diff --git a/backend/src/database/moderation/moderation.service.ts b/backend/src/database/moderation/moderation.service.ts index 249aa8a0..369287c3 100644 --- a/backend/src/database/moderation/moderation.service.ts +++ b/backend/src/database/moderation/moderation.service.ts @@ -4,19 +4,21 @@ import { Moderation, Prisma } from '@prisma/client'; @Injectable() export class ModerationService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createModeration(data: Prisma.ModerationCreateInput): Promise { - return this.prisma.moderation.create({ - data, - }) - } + async createModeration( + data: Prisma.ModerationCreateInput, + ): Promise { + return this.prisma.moderation.create({ + data, + }); + } - async getModeration( - moderationWhereUniqueInput: Prisma.ModerationWhereUniqueInput, - ): Promise { - return this.prisma.moderation.findUnique({ - where: moderationWhereUniqueInput, - }); - } + async getModeration( + moderationWhereUniqueInput: Prisma.ModerationWhereUniqueInput, + ): Promise { + return this.prisma.moderation.findUnique({ + where: moderationWhereUniqueInput, + }); + } } diff --git a/backend/src/database/prisma.service.ts b/backend/src/database/prisma.service.ts index a53ce76f..359f950b 100644 --- a/backend/src/database/prisma.service.ts +++ b/backend/src/database/prisma.service.ts @@ -6,4 +6,4 @@ export class PrismaService extends PrismaClient implements OnModuleInit { async onModuleInit() { await this.$connect(); } -} \ No newline at end of file +} diff --git a/backend/src/database/quest/quest.service.ts b/backend/src/database/quest/quest.service.ts index 994c1e4c..86481ef6 100644 --- a/backend/src/database/quest/quest.service.ts +++ b/backend/src/database/quest/quest.service.ts @@ -4,19 +4,19 @@ import { Prisma, Quest } from '@prisma/client'; @Injectable() export class QuestService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createQuest(data: Prisma.QuestCreateInput): Promise { - return this.prisma.quest.create({ - data, - }) - } + async createQuest(data: Prisma.QuestCreateInput): Promise { + return this.prisma.quest.create({ + data, + }); + } - async getQuest( - questWhereUniqueInput: Prisma.QuestWhereUniqueInput, - ): Promise { - return this.prisma.quest.findUnique({ - where: questWhereUniqueInput, - }); - } + async getQuest( + questWhereUniqueInput: Prisma.QuestWhereUniqueInput, + ): Promise { + return this.prisma.quest.findUnique({ + where: questWhereUniqueInput, + }); + } } diff --git a/backend/src/database/tag/tag.service.ts b/backend/src/database/tag/tag.service.ts index ae401c61..0547b89a 100644 --- a/backend/src/database/tag/tag.service.ts +++ b/backend/src/database/tag/tag.service.ts @@ -4,19 +4,19 @@ import { Prisma, Tag } from '@prisma/client'; @Injectable() export class TagService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createTag(data: Prisma.TagCreateInput): Promise { - return this.prisma.tag.create({ - data, - }) - } + async createTag(data: Prisma.TagCreateInput): Promise { + return this.prisma.tag.create({ + data, + }); + } - async getTag( - tagWhereUniqueInput: Prisma.TagWhereUniqueInput, - ): Promise { - return this.prisma.tag.findUnique({ - where: tagWhereUniqueInput, - }); - } + async getTag( + tagWhereUniqueInput: Prisma.TagWhereUniqueInput, + ): Promise { + return this.prisma.tag.findUnique({ + where: tagWhereUniqueInput, + }); + } } diff --git a/backend/src/database/user-content/user-content.service.ts b/backend/src/database/user-content/user-content.service.ts index ad379326..666e2294 100644 --- a/backend/src/database/user-content/user-content.service.ts +++ b/backend/src/database/user-content/user-content.service.ts @@ -4,50 +4,52 @@ import { PrismaService } from '../prisma.service'; @Injectable() export class UserContentService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - // Question - async createQuestion(data: Prisma.QuestionCreateInput): Promise { - return this.prisma.question.create({ - data, - }) - } + // Question + async createQuestion(data: Prisma.QuestionCreateInput): Promise { + return this.prisma.question.create({ + data, + }); + } - async getQuestion( - questionWhereUniqueInput: Prisma.QuestionWhereUniqueInput, - ): Promise { - return this.prisma.question.findUnique({ - where: questionWhereUniqueInput, - }); - } + async getQuestion( + questionWhereUniqueInput: Prisma.QuestionWhereUniqueInput, + ): Promise { + return this.prisma.question.findUnique({ + where: questionWhereUniqueInput, + }); + } - // Answer - async createAnswer(data: Prisma.AnswerCreateInput): Promise { - return this.prisma.answer.create({ - data, - }) - } + // Answer + async createAnswer(data: Prisma.AnswerCreateInput): Promise { + return this.prisma.answer.create({ + data, + }); + } - async getAnswer( - answerWhereUniqueInput: Prisma.AnswerWhereUniqueInput, - ): Promise { - return this.prisma.answer.findUnique({ - where: answerWhereUniqueInput, - }); - } + async getAnswer( + answerWhereUniqueInput: Prisma.AnswerWhereUniqueInput, + ): Promise { + return this.prisma.answer.findUnique({ + where: answerWhereUniqueInput, + }); + } - // Discussion - async createDiscussion(data: Prisma.DiscussionCreateInput): Promise { - return this.prisma.discussion.create({ - data, - }) - } + // Discussion + async createDiscussion( + data: Prisma.DiscussionCreateInput, + ): Promise { + return this.prisma.discussion.create({ + data, + }); + } - async getDiscussion( - discussionWhereUniqueInput: Prisma.DiscussionWhereUniqueInput, - ): Promise { - return this.prisma.discussion.findUnique({ - where: discussionWhereUniqueInput, - }); - } + async getDiscussion( + discussionWhereUniqueInput: Prisma.DiscussionWhereUniqueInput, + ): Promise { + return this.prisma.discussion.findUnique({ + where: discussionWhereUniqueInput, + }); + } } diff --git a/backend/src/database/user-quest/user-quest.service.ts b/backend/src/database/user-quest/user-quest.service.ts index 791bf8a3..c0245555 100644 --- a/backend/src/database/user-quest/user-quest.service.ts +++ b/backend/src/database/user-quest/user-quest.service.ts @@ -4,19 +4,19 @@ import { Prisma, UserQuest } from '@prisma/client'; @Injectable() export class UserQuestService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createUserQuest(data: Prisma.UserQuestCreateInput): Promise { - return this.prisma.userQuest.create({ - data, - }) - } + async createUserQuest(data: Prisma.UserQuestCreateInput): Promise { + return this.prisma.userQuest.create({ + data, + }); + } - async getUserQuest( - userQuestWhereUniqueInput: Prisma.UserQuestWhereUniqueInput, - ): Promise { - return this.prisma.userQuest.findUnique({ - where: userQuestWhereUniqueInput, - }); - } + async getUserQuest( + userQuestWhereUniqueInput: Prisma.UserQuestWhereUniqueInput, + ): Promise { + return this.prisma.userQuest.findUnique({ + where: userQuestWhereUniqueInput, + }); + } } diff --git a/backend/src/database/user-timeout/user-timeout.service.ts b/backend/src/database/user-timeout/user-timeout.service.ts index 6ad2efd5..f2ec2bbf 100644 --- a/backend/src/database/user-timeout/user-timeout.service.ts +++ b/backend/src/database/user-timeout/user-timeout.service.ts @@ -4,19 +4,21 @@ import { Prisma, UserTimeout } from '@prisma/client'; @Injectable() export class UserTimeoutService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createUserTimeout(data: Prisma.UserTimeoutCreateInput): Promise { - return this.prisma.userTimeout.create({ - data, - }) - } + async createUserTimeout( + data: Prisma.UserTimeoutCreateInput, + ): Promise { + return this.prisma.userTimeout.create({ + data, + }); + } - async getUserTimeout( - userTimeoutWhereUniqueInput: Prisma.UserTimeoutWhereUniqueInput, - ): Promise { - return this.prisma.userTimeout.findUnique({ - where: userTimeoutWhereUniqueInput, - }); - } + async getUserTimeout( + userTimeoutWhereUniqueInput: Prisma.UserTimeoutWhereUniqueInput, + ): Promise { + return this.prisma.userTimeout.findUnique({ + where: userTimeoutWhereUniqueInput, + }); + } } diff --git a/backend/src/database/user/user.service.ts b/backend/src/database/user/user.service.ts index cc9deb37..788ee113 100644 --- a/backend/src/database/user/user.service.ts +++ b/backend/src/database/user/user.service.ts @@ -4,19 +4,19 @@ import { User, Prisma } from '@prisma/client'; @Injectable() export class UserService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createUser(data: Prisma.UserCreateInput): Promise { - return this.prisma.user.create({ - data, - }); - } + async createUser(data: Prisma.UserCreateInput): Promise { + return this.prisma.user.create({ + data, + }); + } - async getUser( - userWhereUniqueInput: Prisma.UserWhereUniqueInput, - ): Promise { - return this.prisma.user.findUnique({ - where: userWhereUniqueInput, - }); - } + async getUser( + userWhereUniqueInput: Prisma.UserWhereUniqueInput, + ): Promise { + return this.prisma.user.findUnique({ + where: userWhereUniqueInput, + }); + } } diff --git a/backend/src/database/vote/vote.service.ts b/backend/src/database/vote/vote.service.ts index 08f46b74..5e06de4a 100644 --- a/backend/src/database/vote/vote.service.ts +++ b/backend/src/database/vote/vote.service.ts @@ -4,19 +4,19 @@ import { Prisma, Vote } from '@prisma/client'; @Injectable() export class VoteService { - constructor(private prisma: PrismaService) { } + constructor(private prisma: PrismaService) {} - async createVote(data: Prisma.VoteCreateInput): Promise { - return this.prisma.vote.create({ - data, - }) - } + async createVote(data: Prisma.VoteCreateInput): Promise { + return this.prisma.vote.create({ + data, + }); + } - async getVote( - voteWhereUniqueInput: Prisma.VoteWhereUniqueInput, - ): Promise { - return this.prisma.vote.findUnique({ - where: voteWhereUniqueInput, - }); - } + async getVote( + voteWhereUniqueInput: Prisma.VoteWhereUniqueInput, + ): Promise { + return this.prisma.vote.findUnique({ + where: voteWhereUniqueInput, + }); + } } diff --git a/backend/src/middleware/auth/auth.middleware.ts b/backend/src/middleware/auth/auth.middleware.ts index 4f313a51..0abe8922 100644 --- a/backend/src/middleware/auth/auth.middleware.ts +++ b/backend/src/middleware/auth/auth.middleware.ts @@ -1,4 +1,3 @@ - import { Injectable, NestMiddleware,