Fixed issue with DMP filter on public datasets

This commit is contained in:
George Kalampokis 2020-06-29 17:18:56 +03:00
parent 7de37fa453
commit 08f7d4aca4
1 changed files with 11 additions and 7 deletions

View File

@ -232,17 +232,21 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
const fields: Array<string> = new Array<string>();
fields.push('asc');
if (this.isPublic) {
const dmpDataTableRequest: DataTableRequest<ExploreDmpCriteriaModel> = new DataTableRequest(0, null, { fields: fields });
dmpDataTableRequest.criteria = new ExploreDmpCriteriaModel();
dmpDataTableRequest.criteria.like = value;
return this.dmpService.getPublicPaged(dmpDataTableRequest, "autocomplete");
} else {
// if (this.isPublic) {
// const dmpDataTableRequest: DataTableRequest<ExploreDmpCriteriaModel> = new DataTableRequest(0, null, { fields: fields });
// dmpDataTableRequest.criteria = new ExploreDmpCriteriaModel();
// dmpDataTableRequest.criteria.like = value;
// return this.dmpService.getPublicPaged(dmpDataTableRequest, "autocomplete");
// } else {
const dmpDataTableRequest: DataTableRequest<DmpCriteria> = new DataTableRequest(0, null, { fields: fields });
dmpDataTableRequest.criteria = new DmpCriteria();
dmpDataTableRequest.criteria.like = value;
return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete");
if (this.isPublic) {
dmpDataTableRequest.criteria.isPublic = true;
dmpDataTableRequest.criteria.onlyPublic = true;
}
return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete");
// }
}
filterGrant(query: string) {