feat: add system configuration platform
This commit is contained in:
@@ -15,11 +15,27 @@ export function jsonSuccess<T extends Record<string, unknown>>(
|
||||
payload: T,
|
||||
status = 200,
|
||||
): Response {
|
||||
return Response.json({ success: true, reason, ...payload }, { status });
|
||||
return Response.json(
|
||||
{ success: true, reason, ...payload },
|
||||
{
|
||||
status,
|
||||
headers: {
|
||||
"Cache-Control": "no-store",
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function jsonFailure(reason: string, status = 400): Response {
|
||||
return Response.json({ success: false, reason }, { status });
|
||||
return Response.json(
|
||||
{ success: false, reason },
|
||||
{
|
||||
status,
|
||||
headers: {
|
||||
"Cache-Control": "no-store",
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export async function readJsonBody(request: Request): Promise<unknown> {
|
||||
@@ -29,4 +45,3 @@ export async function readJsonBody(request: Request): Promise<unknown> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user