import { Injectable } from '@angular/core'; import { of } from 'rxjs'; import { map, tap } from 'rxjs/operators'; import { AppService } from '../app'; import { Room } from '../../models'; @Injectable({providedIn:'root'}) export class RoomsService { ext = "/rooms"; constructor(private app:AppService){} fetch(){return this.app.http.get("/");} fetchOne(id:string){return this.app.http.get("/"+id);} create(o:Room){return this.app.http.post("/",o);} update(id:string,updates:Partial){return this.app.http.put("/"+id,updates);} remove(id:string){return this.app.http.del("/"+id);} }