Just a quick question: I'm working on applying a ValidationPipe
to a POST endpoint responsible for adding an invoice. Before adding the invoice, I need to validate the body.
Here is what I have done:
invoice.dto.ts
import { ContractorDto } from './contractor.dto';
import { IncomeDto } from './income.dto';
import { ExpensesDto } from './expenses.dto';
// Code continues...
export class InvoiceDto {
// Code continues...
}
invoices.controller.ts
type XYZ = Omit<InvoiceDto, 'id'>;
// Code continues...
invoiceValidation.decorator.ts
// Code continues...
I'm facing an issue when trying to use Omit<SCHEMA, OMIT_VALUE>
on the body type, as it seems like my validator is ignoring the omit type and passing all data through. Any help or advice would be greatly appreciated.