Skip to content

Commit

Permalink
Added query parameter restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Dec 11, 2024
1 parent 2fbc755 commit 3e46bdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/BaseEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ export class Model<T> implements IModel<T> {
}
}

export type IPrimitive = string | null | number | boolean;

export default abstract class BaseEntityService extends TaskManager {

public url: string = "/api/entity/";
Expand Down Expand Up @@ -410,7 +412,7 @@ export default abstract class BaseEntityService extends TaskManager {

query<T extends IClrEntity, TR>(m: IModel<T, TR>,
queryFunction?: keyof TR,
... args: any[]): Query<T> {
... args: IPrimitive[]): Query<T> {
return new Query({
service: this,
name: m.name,
Expand All @@ -423,7 +425,7 @@ export default abstract class BaseEntityService extends TaskManager {
queryEntity<T extends IClrEntity, TR>(m: IModel<T, TR>,
entity: T,
queryFunction?: keyof TR,
... args: any[]): Query<T> {
... args: IPrimitive[]): Query<T> {
let entityKey;
const { $key } = entity;
if (!$key) {
Expand Down

0 comments on commit 3e46bdb

Please sign in to comment.