forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgroup.controller.ts
More file actions
35 lines (29 loc) · 1.07 KB
/
Copy pathgroup.controller.ts
File metadata and controls
35 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Controller, Post, Body, Param, Get, Req, Patch } from '@nestjs/common';
import { GroupService } from './group.service';
@Controller('groups')
export class GroupController {
constructor(private readonly groupService: GroupService) {}
@Post()
create(@Body() body: any, @Req() req:any) {
return this.groupService.createGroup(body, req.user.walletAddress);
}
@Patch(':id/add-member')
addMember(@Param('id') id: string, @Body('wallet') wallet :string, @Body('role') role :string, @Req() req:any) {
return this.groupService.addMember(id, wallet, req.user.walletAddress);
}
@Patch(':id/remove-member')
removeMember(@Param('id') id: string, @Body('wallet') wallet:string, @Req() req:any) {
return this.groupService.removeMember(id, wallet, req.user.walletAddress);
}
@Post(':id/split')
createSplit(@Param('id') id: string, @Req() req:any) {
return this.groupService.createSplitFromGroup(
id,
req.user.walletAddress,
);
}
@Get(':id/activity')
activity(@Param('id') id: string) {
return this.groupService.getActivity(id);
}
}