Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
bb41e58c52
commit
55b8eb4874
@@ -740,14 +740,19 @@ function ImportPage() {
|
||||
ctx.caseByExt.clear();
|
||||
ctx.caseByNumber.clear();
|
||||
ctx.caseByTitle.clear();
|
||||
const cases = await fetchAllPaginated<{ id: string; case_number: string | null; title: string | null; external_id: string | null }>(
|
||||
ctx.activeCaseIds.clear();
|
||||
const cases = await fetchAllPaginated<{ id: string; case_number: string | null; title: string | null; external_id: string | null; status: string | null; archived_at: string | null }>(
|
||||
"cases",
|
||||
"id, case_number, title, external_id",
|
||||
"id, case_number, title, external_id, status, archived_at",
|
||||
);
|
||||
const CLOSED_STATUSES = new Set(["closed", "closed_won", "closed_lost"]);
|
||||
for (const r of cases) {
|
||||
if (r.external_id) ctx.caseByExt.set(r.external_id, r.id);
|
||||
if (r.case_number) ctx.caseByNumber.set(r.case_number, r.id);
|
||||
if (r.title) ctx.caseByTitle.set(r.title.toLowerCase().trim(), r.id);
|
||||
if (!r.archived_at && !CLOSED_STATUSES.has(String(r.status ?? "").toLowerCase())) {
|
||||
ctx.activeCaseIds.add(r.id);
|
||||
}
|
||||
}
|
||||
ctx.userByName.clear();
|
||||
ctx.userByEmail.clear();
|
||||
|
||||
Reference in New Issue
Block a user