diff --git a/backend/.env.example b/backend/.env.example index 998439a..434a3d2 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,5 +1,5 @@ DB_HOST=localhost -DB_PORT=5432 +DB_PORT=5445 DB_USERNAME=myuser DB_PASSWORD=mypassword DB_DATABASE=mydb diff --git a/backend/src/user/user.service.ts b/backend/src/user/user.service.ts index eebedfd..6342e59 100644 --- a/backend/src/user/user.service.ts +++ b/backend/src/user/user.service.ts @@ -133,6 +133,10 @@ export class UserService { throw new BadRequestException(`User with email ${email} already exists`); } + if (!password || password.length < 6) { + await this.userRepository.update(id, { name, email, isActive }); + return; + } await this.userRepository.update(id, { name, email, password, isActive }); } /** @@ -156,6 +160,11 @@ export class UserService { throw new BadRequestException(`User with email ${email} already exists`); } + if (!password || password.length < 6) { + await this.userRepository.update(id, { name, email, isActive }); + return; + } + await this.userRepository.update(id, { name, email, password, isActive }); } /** diff --git a/frontend/angular.json b/frontend/angular.json index 00318d8..8825276 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -96,5 +96,8 @@ } } } + }, + "cli": { + "analytics": false } } \ No newline at end of file diff --git a/frontend/src/app/components/dashboard/products/list-products/list-products.component.ts b/frontend/src/app/components/dashboard/products/list-products/list-products.component.ts index 43f000e..9632f57 100644 --- a/frontend/src/app/components/dashboard/products/list-products/list-products.component.ts +++ b/frontend/src/app/components/dashboard/products/list-products/list-products.component.ts @@ -41,7 +41,7 @@ export class ListProductsComponent implements OnInit { summary: 'Sucesso', detail: 'Produto atualizado com sucesso', }); - this.router.navigate(['/dashboard/list-products']); + this.router.navigate(['/dashboard/list-product']); }, (error) => { this.messageService.add({ @@ -61,7 +61,9 @@ export class ListProductsComponent implements OnInit { summary: 'Sucesso', detail: 'Produto deletado com sucesso!', }); - this.router.navigate(['/dashboard/list-products']); + this.products = this.products.filter( + (p) => p.productCode !== product.productCode, + ); }, (error) => { this.messageService.add({