feat: make venues public
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { Controller, Get, Param, UseGuards, Req } from '@nestjs/common';
|
||||
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { VenuesService } from './venues.service';
|
||||
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
|
||||
@ApiTags('Venues')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Controller('venues')
|
||||
export class VenuesController {
|
||||
constructor(
|
||||
@@ -15,18 +13,22 @@ export class VenuesController {
|
||||
) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'List all venues' })
|
||||
@ApiOperation({ summary: 'List all venues (public)' })
|
||||
async findAll() {
|
||||
return this.venuesService.findAll();
|
||||
}
|
||||
|
||||
@Get(':venueId')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiOperation({ summary: 'Get venue by ID' })
|
||||
async findOne(@Param('venueId') venueId: string) {
|
||||
return this.venuesService.findOne(venueId);
|
||||
}
|
||||
|
||||
@Get(':venueId/devices')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiOperation({ summary: 'List devices for a venue' })
|
||||
async findDevices(@Param('venueId') venueId: string) {
|
||||
const devices = await this.prisma.device.findMany({
|
||||
|
||||
Reference in New Issue
Block a user