only show status remove warning if it is being used

This commit is contained in:
Oliver Bryan
2026-01-11 00:14:06 +00:00
parent 69c8ac7bd0
commit 558d0aa3c8
8 changed files with 118 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
export { byProject } from "@/lib/server/issue/byProject";
export { create } from "@/lib/server/issue/create";
export { replaceStatus } from "@/lib/server/issue/replaceStatus";
export { statusCount } from "@/lib/server/issue/statusCount";
export { update } from "@/lib/server/issue/update";

View File

@@ -0,0 +1,28 @@
import { getServerURL } from "@/lib/utils";
import type { ServerQueryInput } from "..";
export async function statusCount({
organisationId,
status,
onSuccess,
onError,
}: {
organisationId: number;
status: string;
} & ServerQueryInput) {
const url = new URL(`${getServerURL()}/issues/status-count`);
url.searchParams.set("organisationId", `${organisationId}`);
url.searchParams.set("status", status);
const res = await fetch(url.toString(), {
credentials: "include",
});
if (!res.ok) {
const error = await res.text();
onError?.(error || `failed to get issue status count (${res.status})`);
} else {
const data = await res.json();
onSuccess?.(data, res);
}
}