show member toroom

This commit is contained in:
Peter Maquiran
2024-06-07 12:29:53 +01:00
parent 486e0e8e72
commit c9b4f2d349
8 changed files with 152 additions and 14 deletions
@@ -7,6 +7,9 @@ import { RoomOutPutDTO } from '../../dto/room/roomOutputDTO';
import { AddMemberToRoomInputDTO, AddMemberToRoomInputDTOSchema } from '../../dto/room/addMemberToRoomInputDto';
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
import { DataSourceReturn } from '../../../type';
import { RoomByIdInputDTO, RoomByIdInputDTOSchema } from '../../dto/room/roomByIdInputDTO';
import { RoomByIdOutputDTO, RoomByIdOutputDTOSchema } from '../../dto/room/roomByIdOutputDTO';
import { APIReturn } from 'src/app/services/decorators/api-validate-schema.decorator';
@Injectable({
providedIn: 'root'
@@ -27,8 +30,10 @@ export class RoomRemoteDataSourceService {
return await this.httpService.get<RoomListOutPutDTO>(`${this.baseUrl}/Room`);
}
async getRoom(id: string): Promise<Result<any ,any>> {
return await this.httpService.get<any>(`${this.baseUrl}/Room/${id}`);
@ValidateSchema(RoomByIdInputDTOSchema)
@APIReturn(RoomByIdOutputDTOSchema)
async getRoom(id: RoomByIdInputDTO): DataSourceReturn<RoomByIdOutputDTO> {
return await this.httpService.get(`${this.baseUrl}/Room/${id}`);
}
async updateRoom(id: string, room: any): Promise<Result<any ,any>> {