[feature-136] parse model saber string search to query filter

This commit is contained in:
MathieuG-P
2023-05-16 22:04:33 +02:00
parent db656259e1
commit ace7657edb
2 changed files with 12 additions and 2 deletions
@@ -1,6 +1,7 @@
import { MSGetQuery, MSGetQueryFilter, MSGetQueryFilterType, MSModel } from "shared/models/models/model-saber.model";
import { IpcService } from "../ipc.service";
import { Observable } from "rxjs";
import { MS_QUERY_FILTER_TYPES } from "shared/models/models/constants";
export class ModelSaberService {
@@ -41,6 +42,13 @@ export class ModelSaberService {
return {type: MSGetQueryFilterType.SearchName, value: trimed, isNegative}
}
const [filterType, filterValue] = trimed.split(":");
if(MS_QUERY_FILTER_TYPES.includes(filterType as MSGetQueryFilterType)){
return {type: filterType as MSGetQueryFilterType, value: filterValue, isNegative}
}
return {type: MSGetQueryFilterType.SearchName, value: trimed, isNegative};
});
}