diff --git a/src/rices/rices.controller.ts b/src/rices/rices.controller.ts index 6a5ef82..b16afd0 100644 --- a/src/rices/rices.controller.ts +++ b/src/rices/rices.controller.ts @@ -11,9 +11,10 @@ import { HttpStatus, UnauthorizedException, BadRequestException, + Res, } from '@nestjs/common'; +import { Response } from 'express'; import { RicesService } from './rices.service'; - import { ApiTags, ApiOperation, ApiResponse, ApiHeader } from '@nestjs/swagger'; @ApiTags('rices') @@ -53,17 +54,36 @@ export class RicesController { } @ApiOperation({ summary: 'Get information about a Rice' }) - @ApiResponse({ status: 200, description: 'Returns metadata of the Rice.' }) + @ApiResponse({ + status: 200, + description: 'Returns metadata of the Rice as HTML.', + }) @Get(':slug') - /************* ✨ Codeium Command ⭐ *************/ - /** - * Retrieve metadata of a rice with the given slug. - * @param slug Slug of the rice. - * @returns Metadata of the rice if found, otherwise throws a NotFoundException. - */ - /****** c6f70808-e78d-4b17-a285-d2fd79527659 *******/ - async getRice(@Param('slug') slug: string) { - return this.ricesService.findOne(slug); + async getRice(@Param('slug') slug: string, @Res() res: Response) { + const riceMetadata = await this.ricesService.findOne(slug); + + const htmlContent = ` + +
+ + + +