useTimetableApi.ts 444 B

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