summaryrefslogtreecommitdiff
path: root/server/controllers/chat_room.controller.ts
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-04-01 16:04:00 -0600
committerLogan Hunt <loganhunt@simponic.xyz>2022-04-01 16:04:00 -0600
commitdbb9eea25f80e7984a112409863be5191af5bf5e (patch)
treecca24e23afc5e7bb4b92a0582aaec48f6a08af72 /server/controllers/chat_room.controller.ts
parent1108970a6aeb98a2f113383c6437dd4d862dae10 (diff)
downloadlocchat-dbb9eea25f80e7984a112409863be5191af5bf5e.tar.gz
locchat-dbb9eea25f80e7984a112409863be5191af5bf5e.zip
Added way too much stuff
Diffstat (limited to 'server/controllers/chat_room.controller.ts')
-rw-r--r--server/controllers/chat_room.controller.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/controllers/chat_room.controller.ts b/server/controllers/chat_room.controller.ts
index 3917e54..9b75c1f 100644
--- a/server/controllers/chat_room.controller.ts
+++ b/server/controllers/chat_room.controller.ts
@@ -19,7 +19,11 @@ const haversine = (p1, p2) => {
};
@Controller()
export class ChatRoomController {
- constructor(private chatRoomService: ChatRoomService, private usersService: UsersService) {}
+ constructor(private chatRoomService: ChatRoomService, private usersService: UsersService) {
+ setInterval(() => {
+ console.log('Hello');
+ }, 60 * 1000);
+ }
@Get('/chat_rooms')
async get(@JwtBody() jwtBody: JwtBodyDto, @Query() query: any) {
@@ -57,6 +61,11 @@ export class ChatRoomController {
@Post('/chat_rooms')
async create(@JwtBody() jwtBody: JwtBodyDto, @Body() chatRoom: any) {
+ if (chatRoom.radius > 1000) {
+ return {
+ error: 'Radius cannot be greater than 1000 meters',
+ };
+ }
chatRoom.user = await this.usersService.find(jwtBody.userId);
return await this.chatRoomService.create(chatRoom);
}