import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Version, VersionRevision } from '../core/entities';

@Injectable()
export class VersionRevisionService {
	constructor(
		private http: HttpClient
	) {}

	getVersions(): Observable<Array<Version>> {
		return this.http.get<Array<Version>>(`/api/versionrevisions/versions`);
	}

	findByVersionNumber(versionNumber: string): Observable<Array<VersionRevision>> {
		return this.http.get<Array<VersionRevision>>(`/api/versionrevisions/${versionNumber}`);
	}
}
