Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
refactor(app): initially display all data instead of none from fuse.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yehezkieldio committed Feb 12, 2024
1 parent 332abd7 commit b805ee1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/app/src/pages/complain/form/tempat-sampah.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export function ComplainFormTempatSampah() {

const fuse = new Fuse(!isLoading ? (data.data as TrashBin[]) : [], fuseOptions);

const filteredData = !isLoading ? fuse.search(searchTerm).map((result) => result.item) : [];
const filteredData =
!isLoading && searchTerm === "" ? data.data : fuse.search(searchTerm).map((result) => result.item);

return (
<IonPage>
Expand Down Expand Up @@ -61,7 +62,7 @@ export function ComplainFormTempatSampah() {
<Button
className="font-bold text-xs w-full"
variant={"secondary"}
onClick={() => history.replace(`/complain/form/laporan/${trashBin.id}`)}
onClick={() => history.push(`/complain/form/laporan/${trashBin.id}`)}
>
Laporkan
</Button>
Expand Down

0 comments on commit b805ee1

Please sign in to comment.