update schema usuarios - microservicio usuario
This commit is contained in:
parent
3bc61cbd4f
commit
0cff6dc2f2
|
@ -33,9 +33,12 @@ export class User {
|
|||
@Prop()
|
||||
status: string;
|
||||
|
||||
|
||||
@Prop()
|
||||
date_entry: Date;
|
||||
|
||||
|
||||
@Prop()
|
||||
community_id?: string;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Document } from 'mongoose';
|
||||
|
||||
|
||||
export type UserCommunityDocument = UserCommunity & Document;
|
||||
|
||||
|
||||
@Schema({ collection: 'users_communities' })
|
||||
export class UserCommunity {
|
||||
|
||||
@Prop()
|
||||
user_id: string;
|
||||
|
||||
@Prop()
|
||||
community_id: string;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const UserCommunitySchema = SchemaFactory.createForClass(UserCommunity);
|
|
@ -12,6 +12,11 @@ export class UsersController {
|
|||
return this.userService.create(user);
|
||||
}
|
||||
|
||||
@MessagePattern({ cmd: 'createAdminSystem' })
|
||||
createUserAdmin(@Payload() user: UserDocument) {
|
||||
return this.userService.create(user);
|
||||
}
|
||||
|
||||
@MessagePattern({ cmd: 'findAllUsers' })
|
||||
findAll() {
|
||||
return this.userService.findAll();
|
||||
|
@ -21,6 +26,7 @@ export class UsersController {
|
|||
findOne(@Payload() dni: string) {
|
||||
return this.userService.findOneByDNI(dni);
|
||||
}
|
||||
|
||||
@MessagePattern({ cmd: 'updateUser' })
|
||||
update(@Payload() user: UserDocument) {
|
||||
return this.userService.update(user.id, user);
|
||||
|
|
Loading…
Reference in New Issue