Skip to content

Commit

Permalink
Fixes: netbox-community#8866 - Does not perform API Select Search if …
Browse files Browse the repository at this point in the history
…a django peramiter has not been replaced
  • Loading branch information
minitriga committed Mar 14, 2022
1 parent 1add5ac commit 3edff89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox.js.map

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions netbox/project-static/src/select/api/apiSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,12 @@ export class APISelect {
private async handleSearch(event: Event) {
const { value: q } = event.target as HTMLInputElement;
const url = queryString.stringifyUrl({ url: this.queryUrl, query: { q } });
await this.fetchOptions(url, 'merge');
this.slim.data.search(q);
this.slim.render();
if (!url.includes(`{{`)) {
await this.fetchOptions(url, 'merge');
this.slim.data.search(q);
this.slim.render();
}
return;
}

/**
Expand Down

0 comments on commit 3edff89

Please sign in to comment.