pas de suppression d'agence + correction typo BU

pull/11/head
Clement FERRERE 3 years ago
parent f32d8872d4
commit 19afa1b6c6
  1. 1
      src/app/components/agence/agence-edit/agence-edit.component.html
  2. 6
      src/app/components/agence/agence-edit/agence-edit.component.ts
  3. 2
      src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html
  4. 4
      src/app/services/agence.service.ts

@ -18,7 +18,6 @@
<div> <div>
<button (click)="goBack()">Retour</button> <button (click)="goBack()">Retour</button>
<button type="submit">Sauvegarder les changements</button> <button type="submit">Sauvegarder les changements</button>
<button (click)="delete()">Supprimer l'agence</button>
<button type="reset" (click)="onReset()">Effacer</button> <button type="reset" (click)="onReset()">Effacer</button>
</div> </div>
</form> </form>

@ -47,12 +47,6 @@ export class AgenceEditComponent implements OnInit {
} }
} }
delete():void {
if (this.agence){
this.agenceService.deleteAgence(this.agence)
.subscribe(()=>this.goBack());
}
}
onSubmit() { onSubmit() {
this.submitted = true; this.submitted = true;

@ -28,7 +28,7 @@
<div> <div>
<button (click)="goBack()">Retour</button> <button (click)="goBack()">Retour</button>
<button type="submit">Sauvegarder les changements</button> <button type="submit">Sauvegarder les changements</button>
<button (click)="delete()">Supprimer l'agence</button> <button (click)="delete()">Supprimer la business unit</button>
<button type="reset" (click)="onReset()">Effacer</button> <button type="reset" (click)="onReset()">Effacer</button>
</div> </div>
</form> </form>

@ -29,10 +29,6 @@ export class AgenceService {
return this.http.put<Agence>(this.agencesUrl + "/" + agence.id, body, this.httpOptions); return this.http.put<Agence>(this.agencesUrl + "/" + agence.id, body, this.httpOptions);
} }
deleteAgence(agence: Agence) {
return this.http.delete(this.agencesUrl + "/" + agence.id);
}
addAgence(agence: Agence): Observable<Agence> { addAgence(agence: Agence): Observable<Agence> {
let body = JSON.stringify(agence); let body = JSON.stringify(agence);
return this.http.post<Agence>(this.agencesUrl, body, this.httpOptions); return this.http.post<Agence>(this.agencesUrl, body, this.httpOptions);

Loading…
Cancel
Save