show rooms

This commit is contained in:
Peter Maquiran
2024-06-05 10:28:38 +01:00
parent 39f89a92a5
commit 2e9492db68
10 changed files with 144 additions and 272 deletions
@@ -1,9 +1,10 @@
import { Injectable } from '@angular/core';
import { HttpService } from 'src/app/services/http.service';
import { MessageOutPutDTO } from '../../dto/message/messageOutputDTO';
import { MessageListInputDTO } from '../../dto/message/messageListInputDTO';
import { DataSourceReturn } from '../../../type';
import { MessageInputDTO, MessageInputDTOSchema } from '../../dto/message/messageInputDtO';
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
import { MessageOutPutDTO } from '../../dto/message/messageOutputDTO';
@Injectable({
providedIn: 'root'
@@ -14,8 +15,9 @@ export class MessageRemoteDataSourceService {
constructor(private httpService: HttpService) {}
async sendMessage(message: any) {
return await this.httpService.post<any>(`${this.baseUrl}/Messages`, message);
@ValidateSchema(MessageInputDTOSchema)
async sendMessage(data: MessageInputDTO) {
return await this.httpService.post<MessageOutPutDTO>(`${this.baseUrl}/Messages`, data);
}
async reactToMessage(id: string, reaction: any) {