useGalleryApi.ts 428 B

123456789101112131415161718192021
  1. import { useApi } from './useApi'
  2. export function useGalleryApi() {
  3. const { checkModule } = useApi()
  4. const log = useLogger('GalleryApi')
  5. try {
  6. const galleryModule = checkModule('gallery')
  7. return {
  8. gallery: galleryModule,
  9. }
  10. } catch (e) {
  11. log.error('Ошибка инициализации GalleryApi:', e)
  12. reloadNuxtApp({
  13. force: true
  14. })
  15. return {
  16. gallery: null,
  17. }
  18. }
  19. }