Marc-André Bombeck
d2adf265e4
refactor(api): extract buildJsonErrorResponse from apiError and returnAllZodIssues
...
The W2 `returnAllZodIssues` helper duplicated the meta/headers handling
from `apiError`: same `{headers, ...rest}` destructure, same `metaKeys`
length check, same `...(headers ? {headers} : {})` spread on the
constructor. Six lines that drift the moment one helper gains a feature
(e.g. an `errorId` autoinject for Sentry) the other doesn't.
Extract the shared body into `buildJsonErrorResponse(body, status,
meta)`. Both `apiError` and `returnAllZodIssues` collapse to one-line
constructions of the resource-specific body shape. Wire shape is
byte-identical — the 7-case `api-response-zod` suite and every
downstream `apiError` consumer still see the same envelopes.
2026-05-21 19:27:20 +02:00
..
2026-05-21 19:23:59 +02:00
2026-05-21 19:06:22 +02:00
2026-05-21 19:22:18 +02:00
2026-05-14 23:49:32 +02:00
2026-05-21 19:06:22 +02:00
2026-05-17 19:07:03 +02:00
2026-05-21 19:06:22 +02:00
2026-05-21 11:48:56 +02:00
2026-05-11 08:27:51 +02:00
2026-05-17 19:07:03 +02:00
2026-05-21 17:52:01 +02:00
2026-05-10 11:05:40 +02:00
2026-05-16 21:25:26 +02:00
2026-05-21 19:06:22 +02:00
2026-05-16 21:25:26 +02:00
2026-05-21 19:22:18 +02:00
2026-05-21 19:20:51 +02:00
2026-05-21 18:55:14 +02:00
2026-05-21 19:06:22 +02:00
2026-05-21 19:06:22 +02:00
2026-05-21 19:06:22 +02:00
2026-03-10 20:14:33 +01:00
2026-05-21 12:22:12 +02:00
2026-05-21 12:22:12 +02:00
2026-05-16 21:25:26 +02:00
2026-05-21 19:06:22 +02:00
2026-05-09 21:19:18 +02:00
2026-05-21 17:52:01 +02:00
2026-05-21 18:55:14 +02:00
2026-05-21 19:06:22 +02:00
2026-05-21 19:06:22 +02:00
2026-05-14 23:49:32 +02:00
2026-05-10 22:12:22 +02:00
2026-05-14 23:49:32 +02:00
2026-05-21 19:22:18 +02:00
2026-05-21 12:43:28 +02:00
2026-05-21 19:06:22 +02:00
2026-05-21 19:26:35 +02:00
2026-05-16 19:46:43 +02:00
2026-05-21 19:27:20 +02:00
2026-05-09 02:27:17 +02:00
2026-05-08 14:33:39 +02:00
2026-05-21 17:52:01 +02:00
2026-05-17 09:55:33 +02:00
2026-05-21 11:37:53 +02:00
2026-05-21 18:55:14 +02:00
2026-05-14 23:49:32 +02:00
2026-05-09 21:36:47 +02:00
2026-05-14 23:49:32 +02:00
2026-05-21 17:52:01 +02:00
2026-05-21 17:52:01 +02:00
2026-05-15 22:59:10 +02:00
2026-05-21 12:07:16 +02:00
2026-03-10 20:14:33 +01:00
2026-05-09 02:22:12 +02:00
2026-05-08 17:46:31 +02:00
2026-05-21 17:52:01 +02:00
2026-05-21 10:59:25 +02:00
2026-03-10 20:14:33 +01:00
2026-05-09 02:27:17 +02:00
2026-04-18 17:15:43 +02:00
2026-05-08 14:33:39 +02:00
2026-05-21 19:23:59 +02:00
2026-05-15 22:59:10 +02:00
2026-05-16 19:46:43 +02:00
2026-05-21 17:52:01 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 23:46:09 +02:00
2026-03-10 20:14:33 +01:00
2026-04-18 22:20:12 +02:00