|
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|
|
import { HttpClient, HttpParams } from '@angular/common/http'
|
|
import { HttpClient, HttpParams } from '@angular/common/http'
|
|
|
import { Observable } from 'rxjs';
|
|
import { Observable } from 'rxjs';
|
|
|
import { Environnement } from '../env';
|
|
import { Environnement } from '../env';
|
|
|
-import { ProductionItem } from '../interfaces/production';
|
|
|
|
|
|
|
+import { ProductionShort, ProductionItem } from '../interfaces/production';
|
|
|
|
|
|
|
|
@Injectable({ providedIn: 'root' })
|
|
@Injectable({ providedIn: 'root' })
|
|
|
|
|
|
|
@@ -13,6 +13,11 @@ export class PresentationService
|
|
|
|
|
|
|
|
constructor(private httpClient: HttpClient) { }
|
|
constructor(private httpClient: HttpClient) { }
|
|
|
|
|
|
|
|
|
|
+ getListProduction(): Observable<ProductionShort[]>
|
|
|
|
|
+ {
|
|
|
|
|
+ return this.httpClient.get<ProductionShort[]>(`${this.baseURL}/list-all`);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
getLinkedProductions(id: number): Observable<ProductionItem[]> { return this.httpClient.get<ProductionItem[]>(`${this.baseURL}/list-linked/${id}`); }
|
|
getLinkedProductions(id: number): Observable<ProductionItem[]> { return this.httpClient.get<ProductionItem[]>(`${this.baseURL}/list-linked/${id}`); }
|
|
|
|
|
|
|
|
getUnlinkedProductions(): Observable<ProductionItem[]> { return this.httpClient.get<ProductionItem[]>(`${this.baseURL}/list-unlinked`); }
|
|
getUnlinkedProductions(): Observable<ProductionItem[]> { return this.httpClient.get<ProductionItem[]>(`${this.baseURL}/list-unlinked`); }
|
|
@@ -24,7 +29,7 @@ export class PresentationService
|
|
|
params = params.append('id_cat', id_cat);
|
|
params = params.append('id_cat', id_cat);
|
|
|
params = params.append('id_prod', id_prod);
|
|
params = params.append('id_prod', id_prod);
|
|
|
|
|
|
|
|
- return this.httpClient.put(`${this.baseURL}/add`, { params: params });
|
|
|
|
|
|
|
+ return this.httpClient.get(`${this.baseURL}/add`, { params: params });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
retirerProduction(id_cat: number, id_prod: number): Observable<Object>
|
|
retirerProduction(id_cat: number, id_prod: number): Observable<Object>
|
|
@@ -34,7 +39,7 @@ export class PresentationService
|
|
|
params = params.append('id_cat', id_cat);
|
|
params = params.append('id_cat', id_cat);
|
|
|
params = params.append('id_prod', id_prod);
|
|
params = params.append('id_prod', id_prod);
|
|
|
|
|
|
|
|
- return this.httpClient.put(`${this.baseURL}/remove`, { params: params });
|
|
|
|
|
|
|
+ return this.httpClient.get(`${this.baseURL}/remove`, { params: params });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
avancerProduction(id_cat: number, id_prod: number): Observable<Object>
|
|
avancerProduction(id_cat: number, id_prod: number): Observable<Object>
|
|
@@ -44,7 +49,7 @@ export class PresentationService
|
|
|
params = params.append('id_cat', id_cat);
|
|
params = params.append('id_cat', id_cat);
|
|
|
params = params.append('id_prod', id_prod);
|
|
params = params.append('id_prod', id_prod);
|
|
|
|
|
|
|
|
- return this.httpClient.put(`${this.baseURL}/forward`, { params: params });
|
|
|
|
|
|
|
+ return this.httpClient.get(`${this.baseURL}/up`, { params: params });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
reculerProduction(id_cat: number, id_prod: number): Observable<Object>
|
|
reculerProduction(id_cat: number, id_prod: number): Observable<Object>
|
|
@@ -54,7 +59,7 @@ export class PresentationService
|
|
|
params = params.append('id_cat', id_cat);
|
|
params = params.append('id_cat', id_cat);
|
|
|
params = params.append('id_prod', id_prod);
|
|
params = params.append('id_prod', id_prod);
|
|
|
|
|
|
|
|
- return this.httpClient.put(`${this.baseURL}/backward`, { params: params });
|
|
|
|
|
|
|
+ return this.httpClient.get(`${this.baseURL}/down`, { params: params });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|