Skip to content

Commit

Permalink
Develop (#2017)
Browse files Browse the repository at this point in the history
  • Loading branch information
madan-ideas2it authored Dec 10, 2024
2 parents 0acafa8 + 7dfb867 commit 1af5d68
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function FooterButtons(props) {
isOpen={true}
onClose={onClose}
>
<div className="relative h-[21vh] w-[640px] rounded-[8px] bg-white text-[#000000]">
<div className="relative min-h-[21vh] w-[640px] rounded-[8px] bg-white text-[#000000]">
<div className='absolute top-[10px] right-[10px]'>
<button onClick={onClose}>
<img
Expand Down
2 changes: 1 addition & 1 deletion apps/back-office/components/member-table/member-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ const MemberTable = (props: any) => {
isOpen={true}
onClose={onClose}
>
<div className="relative h-[21vh] w-[640px] rounded-[8px] bg-white text-[#000000]">
<div className="relative min-h-[21vh] w-[640px] rounded-[8px] bg-white text-[#000000]">
<div className='absolute top-[10px] right-[10px]'>
<button onClick={onClose}>
<img
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "PLEventGuest" ALTER COLUMN "teamUid" DROP NOT NULL;
4 changes: 2 additions & 2 deletions apps/web-api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ model PLEventGuest {
updatedAt DateTime @updatedAt
memberUid String
member Member @relation(fields: [memberUid], references: [uid], onDelete: Cascade)
teamUid String
team Team @relation(fields: [teamUid], references: [uid], onDelete: Cascade)
teamUid String?
team Team? @relation(fields: [teamUid], references: [uid], onDelete: Cascade)
eventUid String
event PLEvent @relation(fields: [eventUid], references: [uid], onDelete: Cascade)
additionalInfo Json?
Expand Down
6 changes: 5 additions & 1 deletion apps/web-api/src/members/members.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ export class MembersService {
* @returns result
*/
async verifyMembers(memberIds: string[], userEmail): Promise<any> {
return await this.prisma.$transaction(async (tx) => {
const response = await this.prisma.$transaction(async (tx) => {
const result = await tx.member.updateMany({
where: { uid: { in: memberIds } },
data: {
Expand Down Expand Up @@ -1157,8 +1157,11 @@ export class MembersService {
tx
);
}));

return result;
});
await this.cacheService.reset({ service: 'members' });
return response;
}

/**
Expand Down Expand Up @@ -1427,6 +1430,7 @@ export class MembersService {
): Promise<Member> {
if (member[field] !== newValue) {
member = await this.updateMemberByUid(member.uid, { [field]: newValue }, tx);
await this.cacheService.reset({ service: 'members' });
}
return member;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ export class ParticipantsRequestService {
}
})
);
await this.cacheService.reset({ service: "participants-requests" });
return { count: successCount, results };
}
}
5 changes: 3 additions & 2 deletions apps/web-api/src/pl-events/pl-events.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { NoCache } from '../decorators/no-cache.decorator';
import { MembersService } from '../members/members.service';
import { PLEventLocationsService } from './pl-event-locations.service';
import { PLEventGuestsService } from './pl-event-guests.service';
import { isEmpty } from 'lodash';

const server = initNestServer(apiEvents);
type RouteShape = typeof server.routeShapes;
Expand Down Expand Up @@ -90,7 +91,7 @@ export class PLEventsController {
const member: any = await this.memberService.findMemberByEmail(request["userEmail"]);
const result = await this.memberService.isMemberPartOfTeams(member, [body.teamUid]) ||
await this.memberService.checkIfAdminUser(member);
if (!result) {
if (!result && !isEmpty(body.teamUid) ) {
throw new ForbiddenException(`Member with email ${userEmail} is not part of
team with uid ${body.teamUid} or isn't admin.`);
}
Expand All @@ -117,7 +118,7 @@ export class PLEventsController {
const member: any = await this.memberService.findMemberByEmail(request["userEmail"]);
const result = await this.memberService.isMemberPartOfTeams(member, [body.teamUid]) ||
await this.memberService.checkIfAdminUser(member);
if (!result) {
if (!result && !isEmpty(body.teamUid)) {
throw new ForbiddenException(`Member with email ${userEmail} is not part of team with uid ${body.teamUid} or isn't admin`);
}
const location = await this.eventLocationService.getPLEventLocationByUid(locationUid);
Expand Down

0 comments on commit 1af5d68

Please sign in to comment.