feat(service): HistoryService für API-Interaktionen erstellen

This commit is contained in:
Developer 02 2024-09-07 00:37:54 +02:00
parent 7bc2695da4
commit eb775da7d4
3 changed files with 34 additions and 0 deletions

View File

@ -26,6 +26,7 @@
MessageCompletionSent = 3005
End Enum
'TODO: standardize in xwiki
Public Enum ReferenceType
Receiver
Sender

View File

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { HistoryService } from './history.service';
describe('HistoryService', () => {
let service: HistoryService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(HistoryService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,17 @@
import { Injectable, inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, firstValueFrom } from 'rxjs';
import { API_URL } from '../tokens/index';
@Injectable({
providedIn: 'root'
})
export class HistoryService {
protected url: string;
constructor(private http: HttpClient) {
const api_url = inject(API_URL);
this.url = `${api_url}/history`;
}
}