Category
We'll create the Category resource following the same protocol.
nest g res domain/categoriesDefine the entity's attributes.
id: number;
name: string;
registryDates: RegistryDates;Then, execute the necessary steps to finish assembling the new resource:
In the controller, use the
IdDtowhereveridis being usedRemove the number conversion operator (
+) below each occurrenceUse
PaginationDtoin thefindAll()method (and also in the service)Default page size - 30
Add to the entity the ORM decorators (
@Entity(),@Column(), etc)Define
nameasunique
Register the entity inside the
TypeOrmModulein the resource's own module
Generate and run the migration create-category, as we cannot define the relations yet.
Commit - Creating category entity
Last updated