You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
532 B
13 lines
532 B
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; |
|
import { InvoiceService } from './invoice.service'; |
|
import { Invoice } from './entities/invoice.entity'; |
|
|
|
@Controller('invoice') |
|
export class InvoiceController { |
|
constructor(private readonly invoiceService: InvoiceService) {} |
|
@Post('create') |
|
async createInvoice(@Body() body:{userId:number, totalAmount:number}):Promise<Invoice>{ |
|
const { userId, totalAmount} = body |
|
return this.invoiceService.createInvoice(userId, totalAmount) |
|
} |
|
}
|
|
|