Remove trailing slash from generic service _getOne (if empty path)
This commit is contained in:
parent
6f255d68b4
commit
124ecee0bf
@ -112,7 +112,7 @@ export abstract class GenericService<I> {
|
|||||||
protected _getOne<R = I>(path: List, modelPath = this._defaultModelPath, queryParams?: List<QueryParam>): Observable<R> {
|
protected _getOne<R = I>(path: List, modelPath = this._defaultModelPath, queryParams?: List<QueryParam>): Observable<R> {
|
||||||
const entityPath = path.map(item => encodeURIComponent(item)).join('/');
|
const entityPath = path.map(item => encodeURIComponent(item)).join('/');
|
||||||
|
|
||||||
return this._http.get<R>(`/${this._serviceName}/${encodeURI(modelPath)}/${entityPath}`, {
|
return this._http.get<R>(`/${this._serviceName}/${encodeURI(modelPath)}/${entityPath}`.replace(/\/+$/, ''), {
|
||||||
headers: HeadersConfiguration.getHeaders({ contentType: false }),
|
headers: HeadersConfiguration.getHeaders({ contentType: false }),
|
||||||
params: this._queryParams(queryParams),
|
params: this._queryParams(queryParams),
|
||||||
observe: 'body',
|
observe: 'body',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user