Resolve linter issues, add unit tests, adjust test coverage

This commit is contained in:
2026-02-07 12:24:39 -03:00
parent 430248a4ef
commit 3264b12ea6
45 changed files with 12143 additions and 7918 deletions

View File

@@ -5,7 +5,10 @@ export async function GET() {
const res = await fetch(`${QR_API_URL}/folders`, { cache: 'no-store' });
const data = await res.json();
if (!res.ok) {
return Response.json({ error: data?.error ?? 'Failed' }, { status: res.status });
return Response.json(
{ error: data?.error ?? 'Failed' },
{ status: res.status },
);
}
return Response.json(Array.isArray(data) ? data : data);
} catch (e) {
@@ -23,7 +26,10 @@ export async function POST(request: Request) {
});
const data = await res.json();
if (!res.ok) {
return Response.json({ error: data?.error ?? 'Failed' }, { status: res.status });
return Response.json(
{ error: data?.error ?? 'Failed' },
{ status: res.status },
);
}
return Response.json(data);
} catch (e) {