Add frontend.
This commit is contained in:
16
cerberus/src/app/core/services/application.service.spec.ts
Normal file
16
cerberus/src/app/core/services/application.service.spec.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ApplicationService } from './application.service';
|
||||
|
||||
describe('ApplicationService', () => {
|
||||
let service: ApplicationService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ApplicationService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
17
cerberus/src/app/core/services/application.service.ts
Normal file
17
cerberus/src/app/core/services/application.service.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Application } from '../entities/Application';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ApplicationService {
|
||||
|
||||
constructor(
|
||||
private _httpClient: HttpClient
|
||||
) {}
|
||||
|
||||
add(application: Application): Promise<Application> {
|
||||
return this._httpClient.post<Application>('/api/applications', application).toPromise();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ReferentialDataService } from './referential-data.service';
|
||||
|
||||
describe('ReferentialDataService', () => {
|
||||
let service: ReferentialDataService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ReferentialDataService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
16
cerberus/src/app/core/services/referential-data.service.ts
Normal file
16
cerberus/src/app/core/services/referential-data.service.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ReferentialData } from '../entities/ReferentialData';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ReferentialDataService {
|
||||
constructor(
|
||||
private _httpClient: HttpClient
|
||||
) {}
|
||||
|
||||
getServiceTypes(): Promise<ReferentialData[]> {
|
||||
return this._httpClient.get<ReferentialData[]>('/api/referentialData/serviceTypes').toPromise();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user