Skip to content

Commit

Permalink
Merge 583cfbb into eb3e016
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelyali committed Dec 23, 2019
2 parents eb3e016 + 583cfbb commit 96b5488
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/crud/src/services/crud-service.abstract.ts
Expand Up @@ -117,8 +117,15 @@ export abstract class CrudService<T> {
* @param options
*/
getPrimaryParam(options: CrudRequestOptions): string {
return objKeys(options.params).find(
(param) => options.params[param] && options.params[param].primary,
const param = objKeys(options.params).find(
(n) => options.params[n] && options.params[n].primary,
);

/* istanbul ignore if */
if (!param) {
return undefined;
}

return options.params[param].field;
}
}

0 comments on commit 96b5488

Please sign in to comment.