'Typeorm using class-transformer to change value in table
I'm using Nest.js with Typeorm and library class-transformer:
import { Transform } from 'class-transformer';
@PrimaryGeneratedColumn()
@Transform(
({ value }) => `${value}/${moment().format('MM-YYYY')}`,
)
invoiceNumber: string;
I'm trying to generate somethink like this: 1/01-2022. But still I have only an number e.g 1 (without date).
How I can add date to incremented value?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
