import {
	Controller,
	Get,
	Param,
	Post,
	Body,
	HttpCode,
	HttpStatus,
	Patch,
	Delete,
	Query
} from '@nestjs/common';
import { CoffeesService } from './coffees.service';

@Controller('coffees')
export class CoffeesController {
	constructor(private readonly coffeesService: CoffeesService) {}

	@Get()
	findAll(@Query() paginationQuery) {
	//	const { limit, offset } = paginationQuery;
		return this.coffeesService.findAll();
	}

	@Get(':id')
	findOne(@Param('id') id: string) {
		return this.coffeesService.findOne(id);
	}

	@Post()
	//@HttpCode(HttpStatus.GONE)
	create(@Body() body) {
		return this.coffeesService.create(body);
	}

	@Patch(':id')
	update(@Param('id') id: string, @Body() body) {
		return this.coffeesService.update(id, body);
	}

	@Delete(':id')
	remove(@Param('id') id: string) {
		return this.coffeesService.remove(id);
	}
}
