Fix : add userID to ReadUserDto
This commit is contained in:
@@ -99,7 +99,7 @@ export class GamesController {
|
||||
@Param('id', GamePipe) _game: Document<Game> & Game,
|
||||
): Observable<{ data: string }> {
|
||||
return fromEvent(this.eventEmitter, 'sse.game.' + id).pipe(
|
||||
map((payload) => {
|
||||
map((payload: any) => {
|
||||
return {
|
||||
data: JSON.stringify(payload),
|
||||
};
|
||||
|
||||
@@ -64,7 +64,6 @@ export class LobbyController {
|
||||
|
||||
@Sse('/subscribe')
|
||||
subscribe(): Observable<{ data: string }> {
|
||||
console.log('subscris');
|
||||
return fromEvent(this.eventEmitter, 'sse.lobby').pipe(
|
||||
map((payload) => {
|
||||
return {
|
||||
|
||||
@@ -62,15 +62,22 @@ export class ReadContainerDto extends DatabaseObjectDto {
|
||||
|
||||
export class ReadUserDto extends DatabaseObjectDto {
|
||||
constructor(
|
||||
data: { username: string; avatar: string } & ConstructorParameters<
|
||||
typeof DatabaseObjectDto
|
||||
>[0],
|
||||
data: {
|
||||
username: string;
|
||||
avatar: string;
|
||||
userId: string;
|
||||
} & ConstructorParameters<typeof DatabaseObjectDto>[0],
|
||||
) {
|
||||
super(data);
|
||||
|
||||
this.username = data.username;
|
||||
this.avatar = data.avatar;
|
||||
this.userId = data.userId;
|
||||
}
|
||||
|
||||
@ApiProperty()
|
||||
userId: string;
|
||||
|
||||
@ApiProperty()
|
||||
username: string;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import mongoose, { HydratedDocument, Model, ObjectId, Types } from 'mongoose';
|
||||
import mongoose, { HydratedDocument, Types } from 'mongoose';
|
||||
import { Card } from 'src/cards/schemas/cards.schema';
|
||||
import { CardRole } from 'src/cards/schemas/cards.types';
|
||||
import { User } from 'src/users/schemas/user.entity';
|
||||
|
||||
Reference in New Issue
Block a user