correction de l'erreur avec exclude

This commit is contained in:
batche
2022-10-28 18:41:26 +02:00
parent e401665e71
commit 6879ddaac8
15 changed files with 16 additions and 26 deletions

View File

@@ -1 +1 @@
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,uDAAmD;AACnD,6CAAgD;AAChD,2CAA8C;AAC9C,wEAAoE;AAwB7D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IArBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,0BAAW;YACpB,sCAAiB;YAEjB,qBAAY,CAAC,OAAO,EAAE;YACtB,uBAAa,CAAC,OAAO,CAAC;gBACrB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;gBAC/B,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;gBACzC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;gBACnC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;gBACvC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;gBACvC,gBAAgB,EAAE,IAAI;gBAGtB,WAAW,EAAE,IAAI;aACjB,CAAC;SACJ;QACC,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;KACxB,CAAC;GACW,SAAS,CAAG;AAAZ,8BAAS"} {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,uDAAmD;AACnD,6CAAgD;AAChD,2CAA8C;AAC9C,wEAAoE;AAsB7D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IApBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,0BAAW;YACpB,sCAAiB;YACjB,qBAAY,CAAC,OAAO,EAAE;YACtB,uBAAa,CAAC,OAAO,CAAC;gBACrB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;gBAC/B,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;gBACzC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;gBACnC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;gBACvC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;gBACvC,gBAAgB,EAAE,IAAI;gBAGtB,WAAW,EAAE,IAAI;aACjB,CAAC;SACJ;QACC,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;KACxB,CAAC;GACW,SAAS,CAAG;AAAZ,8BAAS"}

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateUsersDto = void 0; exports.CreateUsersDto = void 0;
const class_transformer_1 = require("class-transformer");
const class_validator_1 = require("class-validator"); const class_validator_1 = require("class-validator");
class CreateUsersDto { class CreateUsersDto {
} }
@@ -24,7 +23,6 @@ __decorate([
], CreateUsersDto.prototype, "email", void 0); ], CreateUsersDto.prototype, "email", void 0);
__decorate([ __decorate([
(0, class_validator_1.IsString)(), (0, class_validator_1.IsString)(),
(0, class_transformer_1.Exclude)(),
__metadata("design:type", String) __metadata("design:type", String)
], CreateUsersDto.prototype, "password", void 0); ], CreateUsersDto.prototype, "password", void 0);
exports.CreateUsersDto = CreateUsersDto; exports.CreateUsersDto = CreateUsersDto;

View File

@@ -1 +1 @@
{"version":3,"file":"create-users.dto.js","sourceRoot":"","sources":["../../../src/users/dto/create-users.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4C;AAC5C,qDAAoD;AAEpD,MAAa,cAAc;CAQ1B;AAPA;IAAC,IAAA,0BAAQ,GAAE;;gDACe;AAC1B;IAAC,IAAA,yBAAO,GAAE;;6CACa;AACvB;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAO,GAAE;;gDACgB;AAP3B,wCAQC"} {"version":3,"file":"create-users.dto.js","sourceRoot":"","sources":["../../../src/users/dto/create-users.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AAGpD,MAAa,cAAc;CAO1B;AANA;IAAC,IAAA,0BAAQ,GAAE;;gDACe;AAC1B;IAAC,IAAA,yBAAO,GAAE;;6CACa;AACvB;IAAC,IAAA,0BAAQ,GAAE;;gDACe;AAN3B,wCAOC"}

View File

@@ -21,7 +21,6 @@ __decorate([
], User.prototype, "id", void 0); ], User.prototype, "id", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)(), (0, typeorm_1.Column)(),
(0, class_validator_1.Length)(5, 25),
__metadata("design:type", String) __metadata("design:type", String)
], User.prototype, "username", void 0); ], User.prototype, "username", void 0);
__decorate([ __decorate([
@@ -48,7 +47,8 @@ __decorate([
__metadata("design:type", Array) __metadata("design:type", Array)
], User.prototype, "addresseeId", void 0); ], User.prototype, "addresseeId", void 0);
User = __decorate([ User = __decorate([
(0, typeorm_1.Entity)('user') (0, typeorm_1.Entity)('user'),
(0, typeorm_1.Unique)(['email', 'username'])
], User); ], User);
exports.User = User; exports.User = User;
//# sourceMappingURL=user.entity.js.map //# sourceMappingURL=user.entity.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../src/users/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qDAAkD;AAClD,qCAA2G;AAC3G,mFAAyE;AAKlE,IAAM,IAAI,GAAV,MAAM,IAAI;CAkChB,CAAA;AAhCA;IAAC,IAA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AAE,CAAC,8BAAU,EAAG,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;;yCAC7C;AAE1B;IAAC,IAAA,mBAAS,GAAE;IACX,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAU,EAAG,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;;yCAC7C;AAxBd,IAAI;IAFhB,IAAA,gBAAM,EAAC,MAAM,CAAC;IACd,IAAA,gBAAM,EAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;GACjB,IAAI,CAyBhB;AAzBY,oBAAI"}

View File

@@ -29,6 +29,7 @@ let UsersController = class UsersController {
return this.usersService.findOne(id); return this.usersService.findOne(id);
} }
create(createUsersDto) { create(createUsersDto) {
console.log(createUsersDto);
return this.usersService.create(createUsersDto); return this.usersService.create(createUsersDto);
} }
update(id, usersUpdateDto) { update(id, usersUpdateDto) {
@@ -54,7 +55,7 @@ __decorate([
], UsersController.prototype, "findOne", null); ], UsersController.prototype, "findOne", null);
__decorate([ __decorate([
(0, common_1.Post)(), (0, common_1.Post)(),
(0, common_1.HttpCode)(common_1.HttpStatus.GONE), (0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
__param(0, (0, common_1.Body)()), __param(0, (0, common_1.Body)()),
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [create_users_dto_1.CreateUsersDto]), __metadata("design:paramtypes", [create_users_dto_1.CreateUsersDto]),

View File

@@ -1 +1 @@
{"version":3,"file":"users.controller.js","sourceRoot":"","sources":["../../src/users/users.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,6EAAyE;AACzE,6DAAwD;AACxD,6DAAwD;AAExD,mDAA+C;AAIxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC3B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAI3D,OAAO,CAAU,eAAoC;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EAAC,KAAK,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAiB,iCAAc;;6CAErE;AAED;IAAC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;6CAElB;AA9BW,eAAe;IAD3B,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAEyB,4BAAY;GAD3C,eAAe,CA+B3B;AA/BY,0CAAe"}

View File

@@ -48,6 +48,7 @@ let UsersService = class UsersService {
return this.userRepository.save(user); return this.userRepository.save(user);
} }
async update(id, updateUserDto) { async update(id, updateUserDto) {
console.log(`Update user ${id} with ${updateUserDto}`);
const user = await this.userRepository.preload(Object.assign({ id: +id }, updateUserDto)); const user = await this.userRepository.preload(Object.assign({ id: +id }, updateUserDto));
if (!user) if (!user)
throw new common_1.HttpException(`The user could not be updated.`, common_1.HttpStatus.NOT_FOUND); throw new common_1.HttpException(`The user could not be updated.`, common_1.HttpStatus.NOT_FOUND);

View File

@@ -1 +1 @@
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../src/users/users.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsG;AACtG,6CAAmD;AAEnD,wDAA8C;AAC9C,qCAA8D;AAG9D,gFAAsE;AACtE,qDAAiD;AAM1C,IAAM,YAAY,GAAlB,MAAM,YAAY;IAExB,YAEiB,cAAgC,EAEhC,oBAA4C;QAF5C,mBAAc,GAAd,cAAc,CAAkB;QAEhC,yBAAoB,GAApB,oBAAoB,CAAwB;IAC1D,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,EAAU;QACvB,IAAI,CAAC,IAAA,gCAAc,EAAC,EAAE,CAAC;YACtB,MAAM,IAAI,sBAAa,CAAC,+BAA+B,EAAC,mBAAU,CAAC,SAAS,CAAC,CAAC;QAC/E,MAAM,IAAI,GAAI,MAAM,IAAI,CAAC,cAAc,CA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AAgC,EAAC,mBAAU,CAAC,SAAS,CAAC,CAAC;QAChF,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACD,CAAA;AApDY,YAAY;IADxB,IAAA,mBAAU,GAAE;IAIX,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;IAEtB,WAAA,IAAA,0BAAgB,EAAC,8BAAU,CAAC,CAAA;qCADI,oBAAU;QAEJ,oBAAU;GANrC,YAAY,CAoDxB;AApDY,oCAAY"}

View File

@@ -5,12 +5,10 @@ import { UsersModule } from './users/users.module';
import { TypeOrmModule } from '@nestjs/typeorm'; import { TypeOrmModule } from '@nestjs/typeorm';
import { ConfigModule } from '@nestjs/config'; import { ConfigModule } from '@nestjs/config';
import { FriendshipsModule } from './friendship/friendships.module'; import { FriendshipsModule } from './friendship/friendships.module';
import { AuthenticationController } from './auth/authentication.controller';
@Module({ @Module({
imports: [UsersModule, imports: [UsersModule,
FriendshipsModule, FriendshipsModule,
// RouterModule.register(routesForUsers),
ConfigModule.forRoot(), ConfigModule.forRoot(),
TypeOrmModule.forRoot({ TypeOrmModule.forRoot({
type: 'postgres', type: 'postgres',

View File

@@ -1,5 +1,5 @@
import { Exclude } from 'class-transformer';
import { IsEmail, IsString } from 'class-validator'; import { IsEmail, IsString } from 'class-validator';
import { Unique } from 'typeorm';
export class CreateUsersDto { export class CreateUsersDto {
@IsString() @IsString()
@@ -7,6 +7,5 @@ export class CreateUsersDto {
@IsEmail() @IsEmail()
readonly email: string; readonly email: string;
@IsString() @IsString()
@Exclude()
readonly password: string; readonly password: string;
} }

View File

@@ -5,25 +5,20 @@ import { Friendship } from "../../friendship/entities/friendship.entity";
@Entity('user') @Entity('user')
// @Unique(['email', 'username']) @Unique(['email', 'username'])
export class User { export class User {
@PrimaryGeneratedColumn() @PrimaryGeneratedColumn()
id: number; id: number;
@Column() @Column()
@Length(5, 25)
username: string; username: string;
@Column() @Column()
@IsEmail() @IsEmail()
email: string; email: string;
//Dans le cadre d'un tableau on peut faire :
// @Column('json', { nullable: true })
@Column() @Column()
// @Exclude()
password: string; password: string;
@Column('json', { nullable: true }) @Column('json', { nullable: true })
@@ -36,8 +31,4 @@ export class User {
@JoinTable() @JoinTable()
@OneToMany(type => Friendship , (friendship) => friendship.addresseeId) @OneToMany(type => Friendship , (friendship) => friendship.addresseeId)
addresseeId: Friendship[]; addresseeId: Friendship[];
// constructor(partial: Partial<User>) {
// Object.assign(this, partial);
// }
} }

View File

@@ -26,8 +26,9 @@ export class UsersController {
} }
@Post() @Post()
@HttpCode(HttpStatus.GONE) @HttpCode(HttpStatus.CREATED)
create(@Body() createUsersDto : CreateUsersDto ) { create(@Body() createUsersDto : CreateUsersDto ) {
console.log(createUsersDto);
return this.usersService.create(createUsersDto); return this.usersService.create(createUsersDto);
} }

View File

@@ -49,6 +49,7 @@ export class UsersService {
} }
async update(id: string, updateUserDto: UpdateUsersDto) { async update(id: string, updateUserDto: UpdateUsersDto) {
console.log(`Update user ${id} with ${updateUserDto}`);
const user = await this.userRepository.preload( const user = await this.userRepository.preload(
{id: +id, {id: +id,
...updateUserDto}); ...updateUserDto});