UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 1.15 kB
import{copy as e}from"../../../i18n/copy.mjs";import t from"../../../../utils/errors/lucid-api-error.mjs";import n from"../../utils/create-service-context.mjs";import r from"../../../../utils/services/service-wrapper.mjs";import i from"../../../../services/locales/get-all.mjs";import a from"../../middleware/authenticate.mjs";import o from"../../openapi/index.mjs";import s from"../../utils/build-response.mjs";import{controllerSchemas as c}from"../../../../schemas/locales.mjs";import l from"zod";import{createFactory as u}from"hono/factory";import{describeRoute as d}from"hono-openapi";const f=u().createHandlers(d({description:`Returns all content locales.`,tags:[`locales`],summary:`Get All Locales`,responses:o.responses({schema:l.toJSONSchema(c.getAll.response),paginated:!0})}),a({tenantScope:`allow-global`}),async a=>{let o=n(a),c=await r(i,{transaction:!1,defaultError:{type:`basic`,name:e(`server:core.routes.locale.fetch.error.name`),message:e(`server:core.routes.locale.fetch.error.message`)}})(o);if(c.error)throw new t(c.error);return a.status(200),a.json(s(a,{data:c.data}))});export{f as default}; //# sourceMappingURL=get-all.mjs.map