Renamed groups to roles in the frontend
Working: Account Cost Centre Employee Product Group Product Role User Client
This commit is contained in:
@ -35,7 +35,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field cdk-overlay-origin="">
|
||||
<mat-label>Yield</mat-label>
|
||||
<input matInput type="number" placeholder="Tield" formControlName="productYield">
|
||||
<input matInput type="number" placeholder="Yield" formControlName="productYield">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
|
||||
|
||||
@ -19,7 +19,7 @@ export class ProductService {
|
||||
}
|
||||
|
||||
get(id: string): Observable<Product> {
|
||||
const getUrl: string = (id === null) ? `${url}/new` : `${url}/${id}`;
|
||||
const getUrl: string = (id === null) ? `${url}` : `${url}/${id}`;
|
||||
return <Observable<Product>>this.http.get<Product>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`))
|
||||
@ -27,15 +27,14 @@ export class ProductService {
|
||||
}
|
||||
|
||||
list(): Observable<Product[]> {
|
||||
const options = {params: new HttpParams().set('l', '')};
|
||||
return <Observable<Product[]>>this.http.get<Product[]>(url, options)
|
||||
return <Observable<Product[]>>this.http.get<Product[]>(`${url}/list`)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'getList'))
|
||||
);
|
||||
}
|
||||
|
||||
save(product: Product): Observable<Product> {
|
||||
return <Observable<Product>>this.http.post<Product>(`${url}/new`, product, httpOptions)
|
||||
return <Observable<Product>>this.http.post<Product>(`${url}`, product, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'save'))
|
||||
);
|
||||
@ -63,19 +62,11 @@ export class ProductService {
|
||||
);
|
||||
}
|
||||
|
||||
autocomplete(term: string): Observable<Product[]> {
|
||||
const options = {params: new HttpParams().set('t', term)};
|
||||
return <Observable<Product[]>>this.http.get<Product[]>(url, options)
|
||||
autocomplete(query: string): Observable<Product[]> {
|
||||
const options = {params: new HttpParams().set('q', query)};
|
||||
return <Observable<Product[]>>this.http.get<Product[]>(`${url}/query`, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'autocomplete'))
|
||||
);
|
||||
}
|
||||
|
||||
balance(id: string, date: string): Observable<number> {
|
||||
const options = {params: new HttpParams().set('b', 'true').set('d', date)};
|
||||
return <Observable<number>>this.http.get<number>(`${url}/${id}`, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'balance'))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user