rl-core-api 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -228,7 +228,7 @@ let UsersService = class UsersService {
|
|
|
228
228
|
Object.assign(user, {
|
|
229
229
|
name: dto.name ?? user.name,
|
|
230
230
|
lastName: dto.lastName ?? user.lastName,
|
|
231
|
-
phone: dto.phone
|
|
231
|
+
phone: dto.phone !== undefined ? dto.phone : user.phone,
|
|
232
232
|
});
|
|
233
233
|
await this.userRepo.save(user);
|
|
234
234
|
return this.findById(userId);
|
|
@@ -11,28 +11,33 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UpdateProfileCommand = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
15
|
const class_validator_1 = require("class-validator");
|
|
16
|
+
const emptyToNull = ({ value }) => typeof value === "string" && value.trim() === "" ? null : value;
|
|
15
17
|
class UpdateProfileCommand {
|
|
16
18
|
}
|
|
17
19
|
exports.UpdateProfileCommand = UpdateProfileCommand;
|
|
18
20
|
__decorate([
|
|
19
21
|
(0, swagger_1.ApiProperty)({ required: false }),
|
|
20
22
|
(0, class_validator_1.IsOptional)(),
|
|
21
|
-
(0, class_validator_1.IsString)(),
|
|
22
|
-
(0, class_validator_1.Length)(2, 100),
|
|
23
|
+
(0, class_validator_1.IsString)({ message: "Nome inválido" }),
|
|
24
|
+
(0, class_validator_1.Length)(2, 100, { message: "O nome precisa ter entre 2 e 100 caracteres" }),
|
|
23
25
|
__metadata("design:type", String)
|
|
24
26
|
], UpdateProfileCommand.prototype, "name", void 0);
|
|
25
27
|
__decorate([
|
|
26
28
|
(0, swagger_1.ApiProperty)({ required: false }),
|
|
27
29
|
(0, class_validator_1.IsOptional)(),
|
|
28
|
-
(0, class_validator_1.IsString)(),
|
|
29
|
-
(0, class_validator_1.Length)(2, 100
|
|
30
|
+
(0, class_validator_1.IsString)({ message: "Sobrenome inválido" }),
|
|
31
|
+
(0, class_validator_1.Length)(2, 100, {
|
|
32
|
+
message: "O sobrenome precisa ter entre 2 e 100 caracteres",
|
|
33
|
+
}),
|
|
30
34
|
__metadata("design:type", String)
|
|
31
35
|
], UpdateProfileCommand.prototype, "lastName", void 0);
|
|
32
36
|
__decorate([
|
|
33
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
37
|
+
(0, swagger_1.ApiProperty)({ required: false, nullable: true }),
|
|
34
38
|
(0, class_validator_1.IsOptional)(),
|
|
35
|
-
(0,
|
|
36
|
-
(0, class_validator_1.
|
|
37
|
-
|
|
39
|
+
(0, class_transformer_1.Transform)(emptyToNull),
|
|
40
|
+
(0, class_validator_1.IsString)({ message: "Telefone inválido" }),
|
|
41
|
+
(0, class_validator_1.Length)(8, 20, { message: "O telefone precisa ter entre 8 e 20 caracteres" }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
38
43
|
], UpdateProfileCommand.prototype, "phone", void 0);
|
package/package.json
CHANGED