import { Injectable } from "@angular/core"; import { Api } from "./api"; import { Observable } from "rxjs"; import { IRslt, SocialInfo } from "../../public-api"; @Injectable({ providedIn: 'root' }) export class SocialService { get route() { return this.api.base + 'social' } constructor(private api: Api) { } setToken(token:string){ this.api.token = token; } get(): Observable> { return this.api.get(this.route + '/token' ) } // getByID(id: string): Observable> { // return this.api.get(this.route + id) // } post(social: SocialInfo): Observable> { return this.api.post(this.route, social) } put(social: SocialInfo): Observable> { return this.api.put(this.route, social) } delete(social: SocialInfo): Observable> { return this.api.delete(this.route + '/' + social._id); } }