Skip to content

Commit

Permalink
add query api.model.list
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphhanna committed Dec 27, 2023
1 parent e4da5ef commit e202e28
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/API/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,17 @@ interface IAPIModel {
/**
list all models authorized to the user
*/
list(user: ISecureUser): Promise<string[]>;
list(query:any ,user: ISecureUser): Promise<string[]>;
/**
returns Model Events (like timers) for authorized to the user and based on specifid query
*/

findEvents(query, user: ISecureUser);
findEvents(query:any, user: ISecureUser);
/**
returns Model Start Events for authorized to the user and based on specifid query
*/

findStartEvents(query, user: ISecureUser);
findStartEvents(query:any, user: ISecureUser);
/**
delete the specified model
*/
Expand Down Expand Up @@ -211,10 +211,9 @@ class APIModel extends APIComponent {
else
return false;
}
public async list(user: ISecureUser): Promise<string[]> {
public async list(query,user: ISecureUser): Promise<string[]> {

const query = {};
if (user.tenantId)
if (user.tenantId)
query['owner'] = user.modelsOwner;
return await this.server.definitions.getList(query);
}
Expand Down

0 comments on commit e202e28

Please sign in to comment.