feat(housekeeping): cut over administration to ase

This commit is contained in:
Simo committed 2026-08-30 20:35:22 +02:00
1 parent c9e35cf602
commit 2b8f73a91d
457 files changed
+589 -55936

No files matched your search

+6 -14
View File
@@ -60,7 +60,6 @@ async function fetchCmsCandidates(
limit: number,
search: string,
openOnly: boolean,
base: "admin" | "mod",
): Promise<TicketInboxRow[]> {
const Creator = alias(User, "inbox_ticket_creator");
const conditions: SQL[] = [];
@@ -102,7 +101,7 @@ async function fetchCmsCandidates(
.limit(limit)
.catch(() => []);
const prefix = base === "mod" ? "/mod/tickets" : "/admin/tickets";
const prefix = "/ase/people/support/tickets";
return rows.map((row) => ({
key: `cms-${row.id}`,
@@ -123,7 +122,6 @@ async function fetchHelpCandidates(
limit: number,
search: string,
openOnly: boolean,
base: "admin" | "mod",
): Promise<TicketInboxRow[]> {
const conditions: SQL[] = [];
@@ -192,7 +190,7 @@ async function fetchHelpCandidates(
: [];
const usernameById = new Map(users.map((u) => [u.id, u.username]));
const prefix = base === "mod" ? "/mod/help-tickets" : "/admin/help-tickets";
const prefix = "/ase/people/support/help-tickets";
return rows.map((row) => ({
key: `help-${row.id}`,
@@ -302,7 +300,6 @@ async function fetchStrictUnifiedTicketInbox(
numericCandidate > 0
? numericCandidate
: null;
const base = options.base ?? "admin";
if (
!Number.isFinite(options.perPage) ||
!Number.isFinite(options.page) ||
@@ -441,12 +438,8 @@ async function fetchStrictUnifiedTicketInbox(
}
const prefix =
row.kind === "cms"
? base === "mod"
? "/mod/tickets"
: "/admin/tickets"
: base === "mod"
? "/mod/help-tickets"
: "/admin/help-tickets";
? "/ase/people/support/tickets"
: "/ase/people/support/help-tickets";
const dateValue =
row.dateValue === null
? null
@@ -497,7 +490,6 @@ export async function fetchUnifiedTicketInbox(
const type = options.type ?? "all";
const openOnly = options.openOnly !== false;
const search = options.search?.trim() ?? "";
const base = options.base ?? "admin";
const includeCms = type === "all" || type === "cms";
const includeHelp = type === "all" || type === "help";
@@ -513,10 +505,10 @@ export async function fetchUnifiedTicketInbox(
const [cmsRows, helpRows] = await Promise.all([
includeCms
? fetchCmsCandidates(window, search, openOnly, base)
? fetchCmsCandidates(window, search, openOnly)
: Promise.resolve([]),
includeHelp
? fetchHelpCandidates(window, search, openOnly, base)
? fetchHelpCandidates(window, search, openOnly)
: Promise.resolve([]),
]);