Corp/backend/FIX_INTEGRATION.md
igor_nadein a590acb762 feat(frontend): добавлен API клиент и восстановлен backend из master
- Создан frontend/src/lib/api.ts с 43 методами для всех API endpoint'ов
- Создан frontend/src/lib/permissions.ts для проверки прав доступа
- Исправлен URL в getChatMessagesAround: /messages/around/ → /messages-around/
- Исправлен параметр: message_id → around_id
- Восстановлен backend из ветки master для стабильности
- Удалены конфликтующие файлы Pages Router (src/pages, App.tsx, providers)
- Оставлена только чистая структура Next.js App Router
- Добавлена документация по миграции API v2
2026-02-24 15:40:50 +03:00

2.0 KiB
Raw Blame History

🔧 Исправление проблемы инициализации calendar integration

Проблема

window.calendarIntegration = undefined, но скрипт подключён.

Быстрое решение - выполните в консоли:

// Проверка наличия скрипта
const scripts = Array.from(document.querySelectorAll('script[type="module"]'));
console.log('Module scripts found:', scripts.length);
scripts.forEach((s, i) => {
  if (s.textContent.includes('calendar')) {
    console.log(`Script ${i}:`, s.textContent.substring(0, 200));
  }
});

Если скрипт найден, но не работает - вручную загрузите:

(async function manualInit() {
  try {
    console.log('🔄 Manually loading calendar integration...');

    // Импорт модуля
    const module = await import('/static/js/components/calendarWidgetIntegration.js');
    console.log('✅ Module loaded:', module);

    // Инициализация
    const { integrateCalendarManager } = module;
    const integration = integrateCalendarManager(window.calendarWidget);

    if (integration) {
      window.calendarIntegration = integration;
      console.log('✅ Integration initialized successfully!');
      console.log('Calendars:', integration.getCalendars().length);
      console.log('Visible:', integration.getVisibleCalendarIds());

      // Перезагрузить события
      if (window.calendarWidget.refetchEvents) {
        window.calendarWidget.refetchEvents();
        console.log('🔄 Events refetched with new integration');
      }
    }
  } catch (error) {
    console.error('❌ Manual init failed:', error);
  }
})();

После выполнения проверьте:

// Должно вернуть объект, а не undefined
window.calendarIntegration

// Должно показать логи с новой системой
window.calendarWidget.refetchEvents()