Simplify
All checks were successful
/ Misc Linters (push) Successful in 23s
/ Build App (push) Successful in 52s
/ Misc Linters (pull_request) Successful in 27s
/ Build App (pull_request) Successful in 59s

This commit is contained in:
Valentin Brandl 2024-08-17 17:22:27 +02:00
parent e2a4335937
commit 58a65856aa
Signed by: vbrandl
GPG Key ID: CAD4DA1A789125F9

View File

@ -4,8 +4,9 @@ import { readdirSync, statSync } from 'fs';
import type { RequestHandler } from './$types';
export const GET: RequestHandler = () => {
let names = readdirSync(storagePath).filter((f) => statSync(`${storagePath}/${f}`).isDirectory());
names = names.toSorted();
const names = readdirSync(storagePath)
.filter((f) => statSync(`${storagePath}/${f}`).isDirectory())
.toSorted();
return json(names);
};