Skip to content

Commit

Permalink
feat(member update): added member details updation api for admin
Browse files Browse the repository at this point in the history
  • Loading branch information
navneethkrish committed Dec 4, 2024
1 parent 6d3e969 commit d263123
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion apps/web-api/src/admin/member.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Body, Controller, Post, UseGuards } from '@nestjs/common';
import { Body, Controller, Param, Patch, Post, UseGuards } from '@nestjs/common';
import { AdminAuthGuard } from '../guards/admin-auth.guard';
import { MembersService } from '../members/members.service';

Expand All @@ -19,4 +19,19 @@ export class MemberController {
const { memberIds } = body;
return await this.membersService.verifyMembers(memberIds, requestor?.email);
}

/**
* Updates a member to a verfied user.
*
* @param body - participation request data with updated member details
* @returns updated member object
*/
@Patch("/:uid")
@UseGuards(AdminAuthGuard)
async updateMemberAndVerify(@Param('uid') uid, @Body() participantsRequest) {
const requestor = await this.membersService.findMemberByRole();
const requestorEmail = requestor?.email ?? '';
return await this.membersService.updateMemberFromParticipantsRequest(uid, participantsRequest, requestorEmail);
}

}

0 comments on commit d263123

Please sign in to comment.