♻️ separate client & proxy resources tables

This commit is contained in:
Fred KISSIE
2025-12-02 02:33:43 +01:00
parent 610e46f2d5
commit 18db4a11c8
5 changed files with 213 additions and 962 deletions

View File

@@ -3,6 +3,8 @@ import { durationToMs } from "./durationToMs";
import { build } from "@server/build";
import { remote } from "./api";
import type ResponseT from "@server/types/Response";
import type { ListSitesResponse } from "@server/routers/site";
import type { AxiosInstance, AxiosResponse } from "axios";
export type ProductUpdate = {
link: string | null;
@@ -65,3 +67,16 @@ export const productUpdatesQueries = {
// because we don't need to listen for new versions there
})
};
export const siteQueries = {
listPerOrg: ({ orgId, api }: { orgId: string; api: AxiosInstance }) =>
queryOptions({
queryKey: ["SITE_PER_ORG", orgId] as const,
queryFn: async ({ signal }) => {
const res = await api.get<AxiosResponse<ListSitesResponse>>(
`/org/${orgId}/sites`
);
return res.data.data.sites;
}
})
};