Disable cache storage on device import draft
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user