Files
grimmory/frontend/src/app/shared/service/version.service.ts
T
James Cox b3fe4fd598 chore(ui): clear shared prefer-inject bucket
Convert the shared layout shell and shared service constructors to field injection so the frontend shell matches the repo's Angular inject() guidance without changing behavior.

Validation: just ui lint
2026-04-22 17:26:49 -04:00

34 lines
788 B
TypeScript

import {inject, Injectable} from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import {API_CONFIG} from '../../core/config/api-config';
export interface AppVersion {
current: string;
latest: string;
}
export interface ReleaseNote {
version: string;
name: string;
changelog: string;
url: string;
publishedAt: string;
}
@Injectable({
providedIn: 'root'
})
export class VersionService {
private http = inject(HttpClient);
private versionUrl = `${API_CONFIG.BASE_URL}/api/v1/version`;
getVersion(): Observable<AppVersion> {
return this.http.get<AppVersion>(this.versionUrl);
}
getChangelog(): Observable<ReleaseNote[]> {
return this.http.get<ReleaseNote[]>(`${this.versionUrl}/changelog`);
}
}