import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ConfigService } from 'src/app/service/config.service';

@Injectable({
  providedIn: 'root',
})
export class FileService {
  constructor(
    private http: HttpClient,
    private config: ConfigService
  ) {}

  getFile(name: string) {
    return this.http.get(`${this.config.settings.api.url}/files/${name}`, {
      responseType: 'blob',
    });
  }
}
