add metods to update room name

This commit is contained in:
Peter Maquiran
2024-06-11 13:48:44 +01:00
parent 4c1ad6d648
commit 540cbbc911
7 changed files with 44 additions and 14 deletions
@@ -11,6 +11,7 @@ import { RoomByIdInputDTO, RoomByIdInputDTOSchema } from '../../dto/room/roomByI
import { RoomByIdOutputDTO, RoomByIdOutputDTOSchema } from '../../dto/room/roomByIdOutputDTO';
import { APIReturn } from 'src/app/services/decorators/api-validate-schema.decorator';
import { UserRemoveListInputDTO, UserRemoveListInputDTOSchema } from '../../dto/room/userRemoveListInputDTO';
import { RoomUpdateInputDTO } from '../../dto/room/roomUpdateInputDTO';
@Injectable({
providedIn: 'root'
@@ -40,8 +41,12 @@ export class RoomRemoteDataSourceService {
return await this.httpService.get(`${this.baseUrl}/Room/${id}`);
}
async updateRoom(id: string, room: any): Promise<Result<any ,any>> {
return await this.httpService.put<any>(`${this.baseUrl}/Room/${id}`, room);
@ValidateSchema(AddMemberToRoomInputDTOSchema)
//@APIReturn(RoomByIdOutputDTOSchema,'update/Room/${id}')
async updateRoom(data: RoomUpdateInputDTO): Promise<DataSourceReturn<RoomUpdateInputDTO>> {
const id = data.roomId
delete data.roomId
return await this.httpService.put<any>(`${this.baseUrl}/Room/${id}`, data);
}
async deleteRoom(id: string): Promise<Result<any ,any>> {