commit
This commit is contained in:
22
src/seller/seller.controller.ts
Normal file
22
src/seller/seller.controller.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
https://docs.nestjs.com/controllers#controllers
|
||||
*/
|
||||
|
||||
import { Controller, Get, HttpException, HttpStatus } from '@nestjs/common';
|
||||
import { SellerService } from './seller.service';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('Seller')
|
||||
@Controller('api/v1/sellers')
|
||||
export class SellerController {
|
||||
|
||||
constructor(private readonly sellerService: SellerService){}
|
||||
|
||||
@Get() getSellers() {
|
||||
try {
|
||||
return this.sellerService.getSellers();
|
||||
} catch (error) {
|
||||
throw new HttpException(error.message, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user