feat: add updateCategoryMine endpoint to manage product category updates
Test Suite / test (24.15.0) (push) Has been cancelled

- Implemented a new PATCH endpoint in ProductsController to update the category of a user's product.
- Added corresponding service method in ProductsService to handle business logic and validation.
- Created UpdateCategoryMineDto for request validation.
- Enhanced error handling for forbidden actions and not found resources.
- Updated API error mapping in Flutter to handle specific forbidden messages.
- Modified ProductPickerField to allow product creation directly from the picker.
- Added tests for the new endpoint and service method to ensure proper functionality and error handling.
This commit is contained in:
Nils-Johan Gynther
2026-05-11 21:41:42 +02:00
parent 8e0166c68a
commit f19c157e8f
15 changed files with 756 additions and 31 deletions
+16 -10
View File
@@ -18,20 +18,20 @@
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.3.0",
"@nestjs/throttler": "^6.4.0",
"@prisma/client": "6.12.0",
"prisma": "6.12.0",
"bcryptjs": "^2.4.3",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.15.1",
"helmet": "^8.0.0",
"multer": "^1.4.5-lts.2",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"prisma": "6.12.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"sharp": "^0.33.5",
"uuid": "^11.1.0",
"helmet": "^8.0.0",
"@nestjs/throttler": "^6.4.0"
"uuid": "^11.1.0"
},
"devDependencies": {
"@nestjs/cli": "^10.3.0",
@@ -39,20 +39,26 @@
"@nestjs/testing": "^10.3.0",
"@types/bcryptjs": "^2.4.6",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.14",
"@types/multer": "^1.4.12",
"@types/node": "^22.15.29",
"@types/passport-jwt": "^4.0.1",
"@types/supertest": "^7.2.0",
"@types/uuid": "^10.0.0",
"typescript": "^5.4.5",
"jest": "^29.7.0",
"supertest": "^7.2.2",
"ts-jest": "^29.2.6",
"@types/jest": "^29.5.14"
"typescript": "^5.4.5"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"moduleFileExtensions": ["js", "json", "ts"]
"moduleFileExtensions": [
"js",
"json",
"ts"
]
}
}
}