Skip to content

Commit

Permalink
update frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
tracyyh committed Feb 28, 2025
1 parent 323c75c commit 78160de
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions apps/web/src/app/_components/form/sections/review-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ export function ReviewSection({ textColor }: { textColor: string }) {
const [locationLabel, setLocationLabel] = useState<string>("");
const [searchTerm, setSearchTerm] = useState<string>("");

useEffect(async () => {
if (searchTerm.length === 2 || searchTerm.length === 3) {
const prefix = searchTerm.toLowerCase();
useEffect(() => {
const fetchLocations = async () => {
if (searchTerm.length === 2 || searchTerm.length === 3) {
const prefix = searchTerm.toLowerCase();

const locationsToUpdate = await api.location.getByPrefix({ prefix });
const locationsToUpdate = await api.location.getByPrefix({ prefix });

if (locationsToUpdate.isSuccess && locationsToUpdate.data) {
setLocations(
locationsToUpdate.map((location: LocationType) => ({
value: location.id,
label: location.city,
})),
);
}
}
};

fetchLocations();

Check failure on line 46 in apps/web/src/app/_components/form/sections/review-section.tsx

View workflow job for this annotation

GitHub Actions / lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}, [searchTerm]);

return (
Expand Down

0 comments on commit 78160de

Please sign in to comment.