import getAccountId from "lib/account/get-account";
import getParams from "lib/api/get-params";
import { filenameSearch } from "@cocalc/server/projects/filename-search";
export default async function handle(req, res) {
const { search } = getParams(req);
try {
const account_id = await getAccountId(req);
if (!account_id) {
throw Error("must be signed in");
}
res.json(await filenameSearch({ search, account_id }));
} catch (err) {
res.json({ error: `${err.message}` });
}
}