Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredx87 committed May 7, 2024
1 parent ee5be04 commit f7645bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions assets/new-request-form-bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/modules/new-request-form/fields/LookupField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface LookupFieldProps {

export function LookupField({ field, onChange }: LookupFieldProps) {
const {
id: fieldId,
label,
error,
value,
Expand All @@ -52,8 +53,13 @@ export function LookupField({ field, onChange }: LookupFieldProps) {
if (inputValue === "") {
setOptions([]);
} else {
const searchParams = new URLSearchParams();
searchParams.set("name", inputValue.toLocaleLowerCase());
searchParams.set("source", "zen:ticket");
searchParams.set("field_id", fieldId.toString());

const response = await fetch(
`/api/v2/custom_objects/${customObjectKey}/records/autocomplete?name=${inputValue.toLocaleLowerCase()}`
`/api/v2/custom_objects/${customObjectKey}/records/autocomplete?${searchParams.toString()}`
);
const data = await response.json();
setOptions(
Expand Down

0 comments on commit f7645bb

Please sign in to comment.