devices list page now uses prefix search to match results better
This commit is contained in:
parent
3732d76156
commit
6360cba756
2 changed files with 7 additions and 3 deletions
|
|
@ -38,6 +38,7 @@ export interface IDeviceAPIContext {
|
|||
keys?: string[],
|
||||
types?: string[],
|
||||
fieldContains?: Map<string, string>,
|
||||
prefixSearch?: string,
|
||||
) => Promise<AxiosResponse<pond.ListDevicesResponse>>;
|
||||
listForUser: (
|
||||
asRoot: boolean,
|
||||
|
|
@ -305,6 +306,7 @@ export default function DeviceProvider(props: PropsWithChildren<Props>) {
|
|||
keys?: string[],
|
||||
types?: string[],
|
||||
fieldContains?: Map<string, string>,
|
||||
prefixSearch?: string,
|
||||
) => {
|
||||
const url = pondURL(
|
||||
"/devices" +
|
||||
|
|
@ -324,7 +326,8 @@ export default function DeviceProvider(props: PropsWithChildren<Props>) {
|
|||
(withMeasurements ? "&measurements=" + withMeasurements.toString() : "") +
|
||||
(keys ? "&keys=" + keys.toString() : "") +
|
||||
(types ? "&types=" + types.toString() : "") +
|
||||
(fieldContains ? "&fieldContains=" + JSON.stringify(Object.fromEntries(fieldContains)) : "")
|
||||
(fieldContains ? "&fieldContains=" + JSON.stringify(Object.fromEntries(fieldContains)) : "") +
|
||||
(prefixSearch ? "&prefixSearch=" + prefixSearch : "")
|
||||
);
|
||||
return new Promise<AxiosResponse<pond.ListDevicesResponse>>((resolve, reject)=>{
|
||||
get<pond.ListDevicesResponse>(url).then(resp => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue