Query all local repos by getting the local repo count

Instead of falling back to the default of 10 repos, set by
radicle-httpd.
We query the local httpd instance for the amount of repos hosted.
This commit is contained in:
Sebastian Martinez
2024-03-13 16:33:30 +01:00
parent 493d33a80a
commit 67eef6caa7
5 changed files with 30 additions and 10 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
import type { ProjectListQuery } from "@httpd-client";
import { loadProjectActivity, type WeeklyActivity } from "@app/lib/commit";
import {
HttpdClient,
@@ -15,10 +17,10 @@ export interface ProjectInfo {
export async function fetchProjectInfos(
baseUrl: BaseUrl,
show: "all" | "pinned",
query?: ProjectListQuery,
): Promise<ProjectInfo[]> {
const api = new HttpdClient(baseUrl);
const projects = await api.project.getAll({ show });
const projects = await api.project.getAll(query);
const info = await Promise.all(
projects.map(async project => {
const [activity, lastCommit] = await Promise.all([