import { Injectable } from "@angular/core"; import { Api } from "./api"; import { Observable } from "rxjs"; import { IRslt, Media } from "../../public-api"; @Injectable({ providedIn: 'root' }) export class MediaService{ get route(){ return this.api.base + 'media' } constructor(private api:Api){} setToken(token:string){ this.api.token = token; } getAll(ids:string[]): Observable> { return this.api.post(this.route + '/ids', ids) } post(media: Media): Observable> { return this.api.post(this.route, media) } put(media: Media): Observable> { return this.api.put(this.route, media) } }