Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #142 from SE-TINF22B2/dev
Browse files Browse the repository at this point in the history
BE: Update dependencies and reformatted code (ESLint)
  • Loading branch information
Integraluminium authored May 11, 2024
2 parents c344807 + 7ee7d32 commit b849306
Show file tree
Hide file tree
Showing 18 changed files with 1,080 additions and 1,080 deletions.
8 changes: 4 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/supertest": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"prisma": "^5.13.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"supertest": "^7.0.0",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
Expand All @@ -73,4 +73,4 @@
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
}
10 changes: 7 additions & 3 deletions backend/src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
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';
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 {
Expand All @@ -25,7 +29,7 @@ export class AppController {

@Post('user')
async createUser(@Body() user: Prisma.UserCreateInput): Promise<User> {
return this.userService.createUser(user);
return this.userService.createUser(user);
}

@Get('user')
Expand Down
2 changes: 1 addition & 1 deletion backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { AuthMiddleware } from './middleware/auth/auth.middleware';
imports: [ConfigModule.forRoot()],
controllers: [AppController],
providers: [
AppService,
AppService,
AuthService,
PrismaService,
UserService,
Expand Down
34 changes: 18 additions & 16 deletions backend/src/database/blacklist/blacklist.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Blacklist> {
return this.prisma.blacklist.create({
data,
})
}
async createBlacklistItem(
data: Prisma.BlacklistCreateInput,
): Promise<Blacklist> {
return this.prisma.blacklist.create({
data,
});
}

async getBlacklistItem(
blacklistWhereUniqueInput: Prisma.BlacklistWhereUniqueInput,
): Promise<Blacklist | null> {
return this.prisma.blacklist.findUnique({
where: blacklistWhereUniqueInput,
});
}
async getBlacklistItem(
blacklistWhereUniqueInput: Prisma.BlacklistWhereUniqueInput,
): Promise<Blacklist | null> {
return this.prisma.blacklist.findUnique({
where: blacklistWhereUniqueInput,
});
}

async getAllBlacklistItems(): Promise<Blacklist[]> {
return this.prisma.blacklist.findMany();
}
async getAllBlacklistItems(): Promise<Blacklist[]> {
return this.prisma.blacklist.findMany();
}
}
26 changes: 13 additions & 13 deletions backend/src/database/expert/expert.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Expert> {
return this.prisma.expert.create({
data,
})
}
async createExpert(data: Prisma.ExpertCreateInput): Promise<Expert> {
return this.prisma.expert.create({
data,
});
}

async getExpert(
expertWhereUniqueInput: Prisma.ExpertWhereUniqueInput,
): Promise<Expert | null> {
return this.prisma.expert.findUnique({
where: expertWhereUniqueInput,
});
}
async getExpert(
expertWhereUniqueInput: Prisma.ExpertWhereUniqueInput,
): Promise<Expert | null> {
return this.prisma.expert.findUnique({
where: expertWhereUniqueInput,
});
}
}
26 changes: 13 additions & 13 deletions backend/src/database/favorite/favorite.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Favorite> {
return this.prisma.favorite.create({
data,
})
}
async createFavorite(data: Prisma.FavoriteCreateInput): Promise<Favorite> {
return this.prisma.favorite.create({
data,
});
}

async getFavorite(
favoriteWhereUniqueInput: Prisma.FavoriteWhereUniqueInput,
): Promise<Favorite | null> {
return this.prisma.favorite.findUnique({
where: favoriteWhereUniqueInput,
});
}
async getFavorite(
favoriteWhereUniqueInput: Prisma.FavoriteWhereUniqueInput,
): Promise<Favorite | null> {
return this.prisma.favorite.findUnique({
where: favoriteWhereUniqueInput,
});
}
}
28 changes: 15 additions & 13 deletions backend/src/database/login-attempt/login-attempt.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<LoginAttempt> {
return this.prisma.loginAttempt.create({
data,
})
}
async createLoginAttempt(
data: Prisma.LoginAttemptCreateInput,
): Promise<LoginAttempt> {
return this.prisma.loginAttempt.create({
data,
});
}

async getLoginAttempt(
loginAttemptWhereUniqueInput: Prisma.LoginAttemptWhereUniqueInput,
): Promise<LoginAttempt | null> {
return this.prisma.loginAttempt.findUnique({
where: loginAttemptWhereUniqueInput,
});
}
async getLoginAttempt(
loginAttemptWhereUniqueInput: Prisma.LoginAttemptWhereUniqueInput,
): Promise<LoginAttempt | null> {
return this.prisma.loginAttempt.findUnique({
where: loginAttemptWhereUniqueInput,
});
}
}
28 changes: 15 additions & 13 deletions backend/src/database/moderation/moderation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Moderation> {
return this.prisma.moderation.create({
data,
})
}
async createModeration(
data: Prisma.ModerationCreateInput,
): Promise<Moderation> {
return this.prisma.moderation.create({
data,
});
}

async getModeration(
moderationWhereUniqueInput: Prisma.ModerationWhereUniqueInput,
): Promise<Moderation | null> {
return this.prisma.moderation.findUnique({
where: moderationWhereUniqueInput,
});
}
async getModeration(
moderationWhereUniqueInput: Prisma.ModerationWhereUniqueInput,
): Promise<Moderation | null> {
return this.prisma.moderation.findUnique({
where: moderationWhereUniqueInput,
});
}
}
2 changes: 1 addition & 1 deletion backend/src/database/prisma.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
async onModuleInit() {
await this.$connect();
}
}
}
26 changes: 13 additions & 13 deletions backend/src/database/quest/quest.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Quest> {
return this.prisma.quest.create({
data,
})
}
async createQuest(data: Prisma.QuestCreateInput): Promise<Quest> {
return this.prisma.quest.create({
data,
});
}

async getQuest(
questWhereUniqueInput: Prisma.QuestWhereUniqueInput,
): Promise<Quest | null> {
return this.prisma.quest.findUnique({
where: questWhereUniqueInput,
});
}
async getQuest(
questWhereUniqueInput: Prisma.QuestWhereUniqueInput,
): Promise<Quest | null> {
return this.prisma.quest.findUnique({
where: questWhereUniqueInput,
});
}
}
26 changes: 13 additions & 13 deletions backend/src/database/tag/tag.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Tag> {
return this.prisma.tag.create({
data,
})
}
async createTag(data: Prisma.TagCreateInput): Promise<Tag> {
return this.prisma.tag.create({
data,
});
}

async getTag(
tagWhereUniqueInput: Prisma.TagWhereUniqueInput,
): Promise<Tag | null> {
return this.prisma.tag.findUnique({
where: tagWhereUniqueInput,
});
}
async getTag(
tagWhereUniqueInput: Prisma.TagWhereUniqueInput,
): Promise<Tag | null> {
return this.prisma.tag.findUnique({
where: tagWhereUniqueInput,
});
}
}
Loading

0 comments on commit b849306

Please sign in to comment.