import { Injectable } from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs'; import {Tutorial} from '../../models/tutorial.model'; import {GlobalConstants} from '../../global-constants'; @Injectable({ providedIn: 'root' }) export class ModeratorApiService { baseUrl = `${GlobalConstants.API_URL}/moderator`; constructor(private http: HttpClient) { } getBePublishedTutorials(): Observable { return this.http.get(`${this.baseUrl}/tutorials`); } getTutorial(fileName: string | null | undefined): Observable { return this.http.get(`${this.baseUrl}/tutorial-get/${fileName}`); } publish(fileName: any,data: any): Observable { return this.http.put(`${this.baseUrl}/tutorial-update/${fileName}`, data); } }