@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 1.1 kB
Source Map (JSON)
{"version":3,"file":"check-has-media-strategy.mjs","names":[],"sources":["../../../../src/services/media/checks/check-has-media-strategy.ts"],"sourcesContent":["import { copy } from \"../../../libs/i18n/index.js\";\nimport type { MediaAdapterInstance } from \"../../../libs/media/types.js\";\nimport type {\n\tServiceContext,\n\tServiceResponse,\n} from \"../../../utils/services/types.js\";\n\nconst checkHasMediaStrategy = async (\n\tcontext: ServiceContext,\n): ServiceResponse<MediaAdapterInstance> => {\n\tif (!context.media) {\n\t\treturn {\n\t\t\terror: {\n\t\t\t\ttype: \"basic\",\n\t\t\t\tname: copy(\"server:core.config.error.name\"),\n\t\t\t\tmessage: copy(\"server:core.media.strategy.not.configured.message\"),\n\t\t\t\tstatus: 500,\n\t\t\t},\n\t\t\tdata: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\terror: undefined,\n\t\tdata: context.media,\n\t};\n};\n\nexport default checkHasMediaStrategy;\n"],"mappings":"mDAOA,MAAM,EAAwB,KAC7B,IAEK,EAAQ,MAYN,CACN,MAAO,IAAA,GACP,KAAM,EAAQ,KACf,EAdQ,CACN,MAAO,CACN,KAAM,QACN,KAAM,EAAK,+BAA+B,EAC1C,QAAS,EAAK,mDAAmD,EACjE,OAAQ,GACT,EACA,KAAM,IAAA,EACP"}