Skip to content

Commit a344eb1

Browse files
Fix jsonResponse to include indentation for JSON output
1 parent 7975147 commit a344eb1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

utils/responses.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { STATUS } from "../config/constants";
22

3+
const JSON_INDENT_SPACES = 2;
4+
35
export function jsonResponse(data, status = 200, headers = {}) {
4-
return new Response(JSON.stringify(data), {
6+
return new Response(JSON.stringify(data, null, JSON_INDENT_SPACES), {
57
status,
68
headers: {
79
"content-type": "application/json; charset=utf-8",

0 commit comments

Comments
 (0)