mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
list room
This commit is contained in:
+2
-2
@@ -23,8 +23,8 @@ export class RoomRemoteDataSourceService {
|
||||
return await this.httpService.post<RoomOutPutDTO>(`${this.baseUrl}/Room`, data);
|
||||
}
|
||||
|
||||
async getRoomList(): Promise<Result<RoomListOutPutDTO ,any>> {
|
||||
return await this.httpService.get<any>(`${this.baseUrl}/Room`);
|
||||
async getRoomList(): Promise<DataSourceReturn<RoomListOutPutDTO>> {
|
||||
return await this.httpService.get<RoomListOutPutDTO>(`${this.baseUrl}/Room`);
|
||||
}
|
||||
|
||||
async getRoom(id: string): Promise<Result<any ,any>> {
|
||||
|
||||
+12
-2
@@ -28,6 +28,16 @@ roomDataSource.version(1).stores({
|
||||
room: '++id, createdBy, roomName, roomType, expirationDate'
|
||||
});
|
||||
|
||||
|
||||
interface CreateRoomParams {
|
||||
id?: string;
|
||||
roomName?: string;
|
||||
createdBy?: any;
|
||||
createdAt?: Date;
|
||||
expirationDate?: Date;
|
||||
roomType?: any;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -38,10 +48,10 @@ export class RoomLocalDataSourceService {
|
||||
constructor() {}
|
||||
|
||||
|
||||
async createRoom(data: RoomOutPutDTO) {
|
||||
async createRoom(data: CreateRoomParams) {
|
||||
|
||||
try {
|
||||
const result = await roomDataSource.room.add(data.data)
|
||||
const result = await roomDataSource.room.add(data)
|
||||
return ok(result)
|
||||
} catch (e) {
|
||||
return err(false)
|
||||
|
||||
Reference in New Issue
Block a user