Skip to content

Commit

Permalink
Merge pull request #92 from manito42/master
Browse files Browse the repository at this point in the history
[Update] Hotfix update
  • Loading branch information
JuneParkCode authored Sep 16, 2023
2 parents afe2b6a + 5be8a86 commit 68aa878
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions src/models/user/queries/userReservationWhere.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export const getUserReservationsWhereQuery = (
role: ReservationRole,
status: ReservationStatus[],
): any => {
const whereQuery = {};
whereQuery['OR'] = [];
if (role === ReservationRole.MENTEE || role === ReservationRole.ALL)
whereQuery['OR'].push({ menteeId: id });
if (role === ReservationRole.MENTOR || role === ReservationRole.ALL)
whereQuery['OR'].push({ mentorId: id });
status.forEach((s) => {
whereQuery['OR'].push({ status: s });
});
const whereQuery = { status: { in: status } };

if (role === ReservationRole.ALL) {
whereQuery['OR'] = [{ menteeId: id }, { mentorId: id }];
} else if (role === ReservationRole.MENTEE) {
whereQuery['menteeId'] = id;
} else {
whereQuery['mentorId'] = id;
}
return whereQuery;
};
6 changes: 3 additions & 3 deletions src/modules/home/home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { HomeController } from './home.controller';
import { HomeService } from './home.service';
import { MentorProfileModule } from '../../models/mentorProfile/mentorProfile.module';
import { MentorProfileService } from '../../models/mentorProfile/mentorProfile.service';
import { PrismaService } from '../../database/services/prisma.service';
import { PrismaModule } from '../../database/services/prisma.module';

@Module({
imports: [MentorProfileModule],
imports: [MentorProfileModule, PrismaModule],
controllers: [HomeController],
providers: [HomeService, MentorProfileService, PrismaService],
providers: [HomeService, MentorProfileService],
})
export class HomeModule {}
10 changes: 5 additions & 5 deletions src/modules/search/search.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Module } from '@nestjs/common';
import { SearchController } from './search.controller';
import {MentorProfileModule} from "../../models/mentorProfile/mentorProfile.module";
import {MentorProfileService} from "../../models/mentorProfile/mentorProfile.service";
import {PrismaService} from "../../database/services/prisma.service";
import { MentorProfileModule } from '../../models/mentorProfile/mentorProfile.module';
import { MentorProfileService } from '../../models/mentorProfile/mentorProfile.service';
import { PrismaModule } from '../../database/services/prisma.module';

@Module({
controllers: [SearchController],
imports: [MentorProfileModule],
providers: [MentorProfileService, PrismaService],
imports: [MentorProfileModule, PrismaModule],
providers: [MentorProfileService],
})
export class SearchModule {}

0 comments on commit 68aa878

Please sign in to comment.