23 lines
609 B
TypeScript
23 lines
609 B
TypeScript
/*
|
|
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);
|
|
}
|
|
}
|
|
}
|