Découpage en 1 service par composant

This commit is contained in:
Sébastien André
2020-01-28 17:25:26 +01:00
parent 9f3042ed37
commit 9dbabba5a2
17 changed files with 237 additions and 186 deletions

View File

@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ServiceComm } from '../../services/service-comm.service';
import { ServiceApiPost } from '../../services/service-api-post.service';
import { GearService } from '../../services/gear.service';
import { AddAction } from '../../models/add-action.enum';
@@ -14,7 +14,7 @@ import { AddAction } from '../../models/add-action.enum';
export class NewGearComponent implements OnInit {
public addForm: FormGroup;
constructor(private serviceComm: ServiceComm, private servicePost: ServiceApiPost) {
constructor(private serviceComm: ServiceComm, private serviceApi: GearService) {
this.addForm = new FormGroup({
name: new FormControl('', Validators.required),
manufacturer: new FormControl('', Validators.required),
@@ -30,7 +30,7 @@ export class NewGearComponent implements OnInit {
}
onSubmit(formData) {
this.servicePost.AddGear(
this.serviceApi.AddGear(
formData.value.name,
formData.value.manufacturer,
formData.value.minSize,