mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 18:07:54 +00:00
Add UserSpaceRepositoryModule and UserSpaceRepository to CommunityModule
This commit is contained in:
@@ -10,11 +10,15 @@ import {
|
||||
Put,
|
||||
Query,
|
||||
UseGuards,
|
||||
ValidationPipe,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../../../libs/common/src/guards/jwt.auth.guard';
|
||||
import { AddCommunityDto } from '../dtos/add.community.dto';
|
||||
import { GetCommunityChildDto } from '../dtos/get.community.dto';
|
||||
import {
|
||||
GetCommunitiesByUserIdDto,
|
||||
GetCommunityChildDto,
|
||||
} from '../dtos/get.community.dto';
|
||||
import { UpdateCommunityNameDto } from '../dtos/update.community.dto';
|
||||
|
||||
@ApiTags('Community Module')
|
||||
@@ -77,6 +81,22 @@ export class CommunityController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
async getCommunitiesByUserId(
|
||||
@Query(ValidationPipe) dto: GetCommunitiesByUserIdDto,
|
||||
) {
|
||||
try {
|
||||
return await this.communityService.getCommunitiesByUserId(dto.userUuid);
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Put('rename/:communityUuid')
|
||||
|
||||
Reference in New Issue
Block a user