summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole3/frontend/src/app/api/repository.service.ts
blob: 55fd88a07ddad90384b2ac8fe06d6c41e4a2d69d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Injectable } from '@angular/core';
import { HttpClient} from '@angular/common/http';

import { environment } from '../../environments/environment';
import { Repository } from '../model/repository';
import { RepositorySerializer } from '../serializer/repository.serializer';

import {ResourceService} from 'globunet-angular/core/providers/api/resource.service';
import {Observable} from 'rxjs';


@Injectable({
  providedIn: 'root'
})
export class RepositoryService extends ResourceService<Repository> {

	constructor(http: HttpClient) {
		super(http, environment.API_URL, 'repositories', new RepositorySerializer());
	}

  getInfo(repository: Repository) {
    const url = 'https://' + repository.ip + '/' + environment.BASE_DIR + environment.API_BASE_URL;
    return this.httpClient.get(url, {headers: {
      Authorization: repository.randomId
      }});
  }
}