mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add repository patter for chat
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ok, err, Result } from 'neverthrow';
|
||||
import { HttpService } from 'src/app/services/http.service';
|
||||
import { RoomListOutPutDTO } from '../dto/roomOutputDTO';
|
||||
|
||||
import { RoomListOutPutDTO } from '../dto/roomListOutputDTO';
|
||||
import { RoomListInputDTO } from '../dto/roomInputDTO';
|
||||
import { RoomOutPutDTO } from '../dto/roomOutputDTO';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RoomRemoteDataSourceService {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
||||
|
||||
constructor(private httpService: HttpService) {}
|
||||
|
||||
@@ -21,11 +22,10 @@ export class RoomRemoteDataSourceService {
|
||||
return await this.httpService.post<any>(`${this.baseUrl}/Messages/${id}/React`, reaction);
|
||||
}
|
||||
|
||||
async createRoom(room: any): Promise<Result<any ,any>> {
|
||||
return await this.httpService.post<any>(`${this.baseUrl}/Room`, room);
|
||||
async createRoom(data: RoomListInputDTO): Promise<Result<RoomOutPutDTO ,any>> {
|
||||
return await this.httpService.post<any>(`${this.baseUrl}/Room`, data);
|
||||
}
|
||||
|
||||
|
||||
async getRoomList(): Promise<Result<RoomListOutPutDTO ,any>> {
|
||||
return await this.httpService.get<any>(`${this.baseUrl}/Room`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user