diff --git a/src/app/api/measurements/batch/route.ts b/src/app/api/measurements/batch/route.ts index fb0021a56..a5587cf25 100644 --- a/src/app/api/measurements/batch/route.ts +++ b/src/app/api/measurements/batch/route.ts @@ -137,7 +137,7 @@ async function postBatch(request: NextRequest): Promise { (rawBody as { entries: unknown[] }).entries.length > MAX_BATCH_ENTRIES ) { return apiError(`Batch exceeds the ${MAX_BATCH_ENTRIES}-entry limit`, 422, { - errorCode: "coach.batch.too_large", + errorCode: "measurement.batch.too_large", }); } diff --git a/tests/integration/measurements-batch.test.ts b/tests/integration/measurements-batch.test.ts index b2ef109e3..43ae5b3b3 100644 --- a/tests/integration/measurements-batch.test.ts +++ b/tests/integration/measurements-batch.test.ts @@ -195,7 +195,7 @@ describe("POST /api/measurements/batch (real Postgres)", () => { expect(stored).toHaveLength(2); }); - it("returns 422 with coach.batch.too_large when entries exceed the cap", async () => { + it("returns 422 with measurement.batch.too_large when entries exceed the cap", async () => { const { POST } = await import("@/app/api/measurements/batch/route"); const entries: BatchEntryFixture[] = []; @@ -217,7 +217,7 @@ describe("POST /api/measurements/batch (real Postgres)", () => { meta?: { errorCode?: string }; }; expect(json.error).toMatch(/500/); - expect(json.meta?.errorCode).toBe("coach.batch.too_large"); + expect(json.meta?.errorCode).toBe("measurement.batch.too_large"); }); it("flags unmappable identifiers and out-of-range values as skipped", async () => {