Disable cache storage on device import draft

This commit is contained in:
kris
2026-04-07 14:01:56 +08:00
parent 4052822595
commit b1fa3c9b26
2 changed files with 14 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from "next/server";
import { NextRequest } from "next/server";
import { jsonNoStore } from "@/lib/api-response";
import { authorizeDeviceSessionRequest } from "@/lib/boss-device-auth";
import { getLatestDeviceImportDraft } from "@/lib/boss-data";
@@ -9,11 +10,11 @@ export async function GET(
const { deviceId } = await context.params;
const auth = await authorizeDeviceSessionRequest(request, deviceId);
if (!auth.ok) {
return NextResponse.json(
return jsonNoStore(
{ ok: false, message: auth.status === 404 ? "DEVICE_NOT_FOUND" : "UNAUTHORIZED" },
{ status: auth.status },
);
}
const result = await getLatestDeviceImportDraft(deviceId);
return NextResponse.json({ ok: true, ...result });
return jsonNoStore({ ok: true, ...result });
}