Category
We'll now create the Category model, following the same protocol.
model Category {
id Int @id @default(autoincrement())
name String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}Then generate and run the migration, as the relations cannot be set yet.
yarn migrate:create create-category
yarn migrate:runCreate the categories resource
nest g res domain/categoriesAnd perform the steps to finish its assembly
Exclude the entities folder
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
Commit - Creating category model
Last updated