@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 1.58 kB
Source Map (JSON)
{"version":3,"file":"get-all.mjs","names":["localesFormatter"],"sources":["../../../src/services/locales/get-all.ts"],"sourcesContent":["import { localesFormatter } from \"../../libs/formatters/index.js\";\nimport { LocalesRepository } from \"../../libs/repositories/index.js\";\nimport type { Locale } from \"../../types/response.js\";\nimport type { ServiceFn } from \"../../utils/services/types.js\";\n\nconst getAll: ServiceFn<[], Locale[]> = async (context) => {\n\tconst Locales = new LocalesRepository(context.db.client, context.config.db);\n\n\tconst localesRes = await Locales.selectMultiple({\n\t\tselect: [\"code\", \"created_at\", \"updated_at\", \"is_deleted\", \"is_deleted_at\"],\n\t\twhere: [\n\t\t\t{\n\t\t\t\tkey: \"is_deleted\",\n\t\t\t\toperator: \"!=\",\n\t\t\t\tvalue: context.config.db.getDefault(\"boolean\", \"true\"),\n\t\t\t},\n\t\t],\n\t\tvalidation: {\n\t\t\tenabled: true,\n\t\t},\n\t});\n\tif (localesRes.error) return localesRes;\n\n\treturn {\n\t\terror: undefined,\n\t\tdata: localesFormatter.formatMultiple({\n\t\t\tlocales: localesRes.data,\n\t\t\tlocalization: context.config.localization,\n\t\t}),\n\t};\n};\n\nexport default getAll;\n"],"mappings":"oGAKA,MAAM,EAAkC,KAAO,IAAY,CAG1D,IAAM,EAAa,MAAM,IAFL,EAAkB,EAAQ,GAAG,OAAQ,EAAQ,OAAO,EAEzC,CAAC,CAAC,eAAe,CAC/C,OAAQ,CAAC,OAAQ,aAAc,aAAc,aAAc,eAAe,EAC1E,MAAO,CACN,CACC,IAAK,aACL,SAAU,KACV,MAAO,EAAQ,OAAO,GAAG,WAAW,UAAW,MAAM,CACtD,CACD,EACA,WAAY,CACX,QAAS,EACV,CACD,CAAC,EAGD,OAFI,EAAW,MAAc,EAEtB,CACN,MAAO,IAAA,GACP,KAAMA,EAAiB,eAAe,CACrC,QAAS,EAAW,KACpB,aAAc,EAAQ,OAAO,YAC9B,CAAC,CACF,CACD"}