.
This commit is contained in:
@@ -14,7 +14,6 @@ const users_module_1 = require("./users/users.module");
|
||||
const typeorm_1 = require("@nestjs/typeorm");
|
||||
const config_1 = require("@nestjs/config");
|
||||
const friendships_module_1 = require("./friendship/friendships.module");
|
||||
const authentication_controller_1 = require("./auth/authentication.controller");
|
||||
let AppModule = class AppModule {
|
||||
};
|
||||
AppModule = __decorate([
|
||||
@@ -33,7 +32,7 @@ AppModule = __decorate([
|
||||
synchronize: true,
|
||||
}),
|
||||
],
|
||||
controllers: [app_controller_1.AppController, authentication_controller_1.AuthenticationController],
|
||||
controllers: [app_controller_1.AppController],
|
||||
providers: [app_service_1.AppService],
|
||||
})
|
||||
], AppModule);
|
||||
|
||||
@@ -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;AACpE,gFAA4E;AAuBrE,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,EAAE,oDAAwB,CAAC;QACtD,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;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"}
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"friendships.module.js","sourceRoot":"","sources":["../../src/friendship/friendships.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6DAAyD;AACzD,mEAA+D;AAC/D,oEAA0D;AAC1D,+DAAqD;AAQ9C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,iBAAiB;IAN7B,IAAA,eAAM,EAAC;QACP,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,8BAAU,EAAE,kBAAI,CAAC,CAAC,CAAC;QACvD,SAAS,EAAE,CAAC,sCAAiB,CAAC;QAC9B,WAAW,EAAE,CAAC,4CAAoB,CAAC;QACnC,OAAO,EAAE,CAAC,sCAAiB,CAAC;KAC5B,CAAC;GACW,iBAAiB,CAAG;AAApB,8CAAiB"}
|
||||
{"version":3,"file":"friendships.module.js","sourceRoot":"","sources":["../../src/friendship/friendships.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6DAAyD;AACzD,mEAA+D;AAC/D,oEAA0D;AAC1D,+DAAqD;AAS9C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,iBAAiB;IAP7B,IAAA,eAAM,EAAC;QACP,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,8BAAU,EAAE,kBAAI,CAAC,CAAC,CAAC;QACvD,SAAS,EAAE,CAAC,sCAAiB,CAAC;QAC9B,WAAW,EAAE,CAAC,4CAAoB,CAAC;QACnC,OAAO,EAAE,CAAC,sCAAiB,CAAC;KAC5B,CAAC;GAEW,iBAAiB,CAAG;AAApB,8CAAiB"}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,5 @@
|
||||
export declare class CreateUsersDto {
|
||||
readonly name: string;
|
||||
readonly username: string;
|
||||
readonly password: string;
|
||||
readonly email: string;
|
||||
readonly password: string;
|
||||
}
|
||||
|
||||
@@ -14,22 +14,18 @@ const class_transformer_1 = require("class-transformer");
|
||||
const class_validator_1 = require("class-validator");
|
||||
class CreateUsersDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "username", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsEmail)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "email", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
(0, class_transformer_1.Exclude)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "password", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsEmail)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "email", void 0);
|
||||
exports.CreateUsersDto = CreateUsersDto;
|
||||
//# sourceMappingURL=create-users.dto.js.map
|
||||
@@ -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;CAU1B;AATA;IAAC,IAAA,0BAAQ,GAAE;;4CACW;AACtB;IAAC,IAAA,0BAAQ,GAAE;;gDACe;AAC1B;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAO,GAAE;;gDACgB;AAC1B;IAAC,IAAA,yBAAO,GAAE;;6CACa;AATxB,wCAUC"}
|
||||
{"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"}
|
||||
@@ -7,5 +7,4 @@ export declare class User {
|
||||
status: [string];
|
||||
requesterId: Friendship[];
|
||||
addresseeId: Friendship[];
|
||||
constructor(partial: Partial<User>);
|
||||
}
|
||||
|
||||
@@ -10,14 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.User = void 0;
|
||||
const class_transformer_1 = require("class-transformer");
|
||||
const class_validator_1 = require("class-validator");
|
||||
const typeorm_1 = require("typeorm");
|
||||
const friendship_entity_1 = require("../../friendship/entities/friendship.entity");
|
||||
let User = class User {
|
||||
constructor(partial) {
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
||||
@@ -35,7 +31,6 @@ __decorate([
|
||||
], User.prototype, "email", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)(),
|
||||
(0, class_transformer_1.Exclude)(),
|
||||
__metadata("design:type", String)
|
||||
], User.prototype, "password", void 0);
|
||||
__decorate([
|
||||
@@ -53,9 +48,7 @@ __decorate([
|
||||
__metadata("design:type", Array)
|
||||
], User.prototype, "addresseeId", void 0);
|
||||
User = __decorate([
|
||||
(0, typeorm_1.Entity)('users'),
|
||||
(0, typeorm_1.Unique)(['email', 'username']),
|
||||
__metadata("design:paramtypes", [Object])
|
||||
(0, typeorm_1.Entity)('user')
|
||||
], User);
|
||||
exports.User = User;
|
||||
//# sourceMappingURL=user.entity.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../src/users/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4C;AAC5C,qDAAkD;AAClD,qCAA2G;AAC3G,mFAAyE;AAKlE,IAAM,IAAI,GAAV,MAAM,IAAI;IA+BhB,YAAY,OAAsB;QACjC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;CACD,CAAA;AAhCA;IAAC,IAAA,gCAAsB,GAAE;;gCACd;AAEX;IAAC,IAAA,gBAAM,GAAE;IACR,IA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ClB;AAEjB;IAAC,IAAA,mBAAS,GAAE;IACX,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,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;AA7Bd,IAAI;IAFhB,IAAA,gBAAM,EAAC,MAAM,CAAC;GAEF,IAAI,CAkChB;AAlCY,oBAAI"}
|
||||
@@ -25,7 +25,7 @@ import { AuthenticationController } from './auth/authentication.controller';
|
||||
synchronize: true,
|
||||
}),
|
||||
],
|
||||
controllers: [AppController, AuthenticationController],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
@@ -11,4 +11,5 @@ import { User } from '../users/entities/user.entity';
|
||||
controllers: [FriendshipController],
|
||||
exports: [FriendshipService],
|
||||
})
|
||||
|
||||
export class FriendshipsModule {}
|
||||
|
||||
@@ -2,13 +2,11 @@ import { Exclude } from 'class-transformer';
|
||||
import { IsEmail, IsString } from 'class-validator';
|
||||
|
||||
export class CreateUsersDto {
|
||||
@IsString()
|
||||
readonly name: string;
|
||||
@IsString()
|
||||
readonly username: string;
|
||||
@IsEmail()
|
||||
readonly email: string;
|
||||
@IsString()
|
||||
@Exclude()
|
||||
readonly password: string;
|
||||
@IsEmail()
|
||||
readonly email: string;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import { Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryGeneratedColum
|
||||
import { Friendship } from "../../friendship/entities/friendship.entity";
|
||||
|
||||
|
||||
@Entity('users')
|
||||
@Unique(['email', 'username'])
|
||||
@Entity('user')
|
||||
// @Unique(['email', 'username'])
|
||||
export class User {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
@@ -23,7 +23,7 @@ export class User {
|
||||
//Dans le cadre d'un tableau on peut faire :
|
||||
// @Column('json', { nullable: true })
|
||||
@Column()
|
||||
@Exclude()
|
||||
// @Exclude()
|
||||
password: string;
|
||||
|
||||
@Column('json', { nullable: true })
|
||||
@@ -37,7 +37,7 @@ export class User {
|
||||
@OneToMany(type => Friendship , (friendship) => friendship.addresseeId)
|
||||
addresseeId: Friendship[];
|
||||
|
||||
constructor(partial: Partial<User>) {
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
// constructor(partial: Partial<User>) {
|
||||
// Object.assign(this, partial);
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user