Skip to content

Commit 46701c4

Browse files
committed
fixing pagination param & query
1 parent 3fea4ee commit 46701c4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

components/dashboard/src/repositories/list/RepositoryList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { TextInput } from "../../components/forms/TextInputField";
1919
const RepositoryListPage: FC = () => {
2020
const history = useHistory();
2121
const [searchTerm, setSearchTerm, debouncedSearchTerm] = useStateWithDebounce("");
22-
const { data, isLoading } = useListConfigurations({ searchTerm: debouncedSearchTerm, page: 1, pageSize: 10 });
22+
const { data, isLoading } = useListConfigurations({ searchTerm: debouncedSearchTerm, page: 0, pageSize: 10 });
2323
const [showCreateProjectModal, setShowCreateProjectModal] = useState(false);
2424

2525
const handleProjectCreated = useCallback(

components/gitpod-db/src/typeorm/project-db-impl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export class ProjectDBImpl extends TransactionalDBImpl<ProjectDB> implements Pro
8080

8181
const queryBuilder = projectRepo
8282
.createQueryBuilder("project")
83-
.andWhere(
83+
// TODO: should we make this conditional if searchTerm has a value to avoid the scan?
84+
.where(
8485
new Brackets((qb) => {
8586
qb.where("project.cloneUrl LIKE :searchTerm", { searchTerm: `%${searchTerm}%` }).orWhere(
8687
"project.name LIKE :searchTerm",

0 commit comments

Comments
 (0)