From 52b4b504230a8fb3361788ad00a67fdfa16fb9f0 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Wed, 2 Mar 2022 15:37:04 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20des=20fichiers=20de=20constante?= =?UTF-8?q?s,=20utilis=C3=A9s=20uniquement=20pour=20les=20routes=20pour=20?= =?UTF-8?q?le=20moment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.ts | 1 - src/app/services/agence.service.ts | 3 ++- src/app/services/collaborateur.service.ts | 3 ++- src/ressources/routes/routes.ts | 7 ++----- src/ressources/strings/strings_fr.ts | 5 ----- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 22195c0..a463bf8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,5 +7,4 @@ import { Component } from '@angular/core'; styleUrls: ['./app.component.css'] }) export class AppComponent { - title = 'Collaborateur-Epa'; } diff --git a/src/app/services/agence.service.ts b/src/app/services/agence.service.ts index 2013dd3..e1c80ac 100644 --- a/src/app/services/agence.service.ts +++ b/src/app/services/agence.service.ts @@ -2,12 +2,13 @@ import { Injectable } from '@angular/core'; import {HttpClient, HttpHeaders} from "@angular/common/http"; import {Observable} from "rxjs"; import {Agence} from "../interfaces/agence"; +import {agencesUrl} from "../../ressources/routes/routes"; @Injectable({ providedIn: 'root' }) export class AgenceService { - private agencesUrl = 'https://localhost:7125/api/agences'; + private agencesUrl = agencesUrl; httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) diff --git a/src/app/services/collaborateur.service.ts b/src/app/services/collaborateur.service.ts index 3a93cd5..f410852 100644 --- a/src/app/services/collaborateur.service.ts +++ b/src/app/services/collaborateur.service.ts @@ -2,13 +2,14 @@ import {Collaborateur} from "../interfaces/collaborateur"; import {Injectable} from '@angular/core'; import {Observable} from "rxjs"; import {HttpClient, HttpHeaders} from "@angular/common/http"; +import {collaborateursUrl} from "../../ressources/routes/routes"; @Injectable({providedIn: 'root'}) export class CollaborateurService { - private collaborateursUrl = 'https://localhost:7125/api/collaborateurs'; + private collaborateursUrl = collaborateursUrl; httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) diff --git a/src/ressources/routes/routes.ts b/src/ressources/routes/routes.ts index 1252e15..1eb9e54 100644 --- a/src/ressources/routes/routes.ts +++ b/src/ressources/routes/routes.ts @@ -1,5 +1,2 @@ -import {Injectable} from "@angular/core"; -@Injectable() -export class Routes{ - -} +export const collaborateursUrl = 'https://localhost:7125/api/collaborateurs'; +export const agencesUrl = 'https://localhost:7125/api/agences'; diff --git a/src/ressources/strings/strings_fr.ts b/src/ressources/strings/strings_fr.ts index 992ecee..e69de29 100644 --- a/src/ressources/strings/strings_fr.ts +++ b/src/ressources/strings/strings_fr.ts @@ -1,5 +0,0 @@ -import {Injectable} from "@angular/core"; -@Injectable() -export class Strings_fr{ - -}