import "../../../../../base64-CmWvODNW.mjs";
import "../../../../../types-CuW0zWDA.mjs";
import { a as unwrapResult, t as apiError } from "../../../../../error-CkAseSqZ.mjs";
import { i as parseQuery, t as isParseError } from "../../../../../parse-GmjecGct.mjs";
import { hn as contentTrashQuery } from "../../../../../redirects-DXEXBAII.mjs";
import "../../../../../byline-fields-2Lp5Hbgf.mjs";
import "../../../../../status-CqJQX1QN.mjs";
import "../../../../../api/schemas/index.mjs";
import { n as requirePerm } from "../../../../../authorize-Dz88F_Fw.mjs";

//#region src/astro/routes/api/content/[collection]/trash.ts
const prerender = false;
const GET = async ({ params, url, locals }) => {
	const { emdash, user } = locals;
	const collection = params.collection;
	const denied = requirePerm(user, "content:read_drafts");
	if (denied) return denied;
	if (!emdash?.handleContentListTrashed) return apiError("NOT_CONFIGURED", "EmDash is not initialized", 500);
	const query = parseQuery(url, contentTrashQuery);
	if (isParseError(query)) return query;
	return unwrapResult(await emdash.handleContentListTrashed(collection, query));
};

//#endregion
export { GET, prerender };
//# sourceMappingURL=trash.mjs.map