mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 20:00:33 +00:00
refactor(nestjs): list resources
This commit is contained in:
@@ -6,9 +6,13 @@ import {
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { CustomersApplication } from './CustomersApplication.service';
|
||||
import { ICustomerOpeningBalanceEditDTO } from './types/Customers.types';
|
||||
import {
|
||||
ICustomerOpeningBalanceEditDTO,
|
||||
ICustomersFilter,
|
||||
} from './types/Customers.types';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { CreateCustomerDto } from './dtos/CreateCustomer.dto';
|
||||
import { EditCustomerDto } from './dtos/EditCustomer.dto';
|
||||
@@ -24,6 +28,12 @@ export class CustomersController {
|
||||
return this.customersApplication.getCustomer(customerId);
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'Retrieves the customers paginated list.' })
|
||||
getCustomers(@Query() filterDTO: Partial<ICustomersFilter>) {
|
||||
return this.customersApplication.getCustomers(filterDTO);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Create a new customer.' })
|
||||
createCustomer(@Body() customerDTO: CreateCustomerDto) {
|
||||
|
||||
Reference in New Issue
Block a user