cut,skip fix plus owner fix for view page

This commit is contained in:
makearmy 2025-10-08 23:21:29 -04:00
parent 1156984fa6
commit 12dd2c6c06
2 changed files with 21 additions and 19 deletions

View file

@ -28,8 +28,6 @@ type Row = {
lens?: { field_size?: string | number | null } | null;
};
const API = (process.env.NEXT_PUBLIC_API_BASE_URL || "").replace(/\/$/, "");
async function readJson(r: Response) {
const t = await r.text();
try {
@ -82,16 +80,19 @@ export default function CO2GalvoList({
const fields = [
"submission_id",
"setting_title",
// IMPORTANT: request the expanded relation only (do NOT include bare 'owner' id)
"owner.id",
"owner.username",
"owner.first_name",
"owner.last_name",
"owner.email",
"uploader",
"mat.name",
"mat_coat.name",
"source.model",
"lens.field_size",
].join(",");
const url = `${API}/items/settings_co2gal?fields=${encodeURIComponent(fields)}&limit=-1`;
// Use the same proxy as Details so relation expansion & auth match
const url = `/api/dx/items/settings_co2gal?fields=${encodeURIComponent(fields)}&limit=-1`;
const r = await fetch(url, { credentials: "include", cache: "no-store" });
if (!r.ok) {
const j = await readJson(r);