feat: добавил поддержку подписки на календарь и экспорт расписания лекций в формате .ics
Backend CI / build-and-test (push) Successful in 57s
Frontend CI / build-and-check (push) Failing after 26s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 11s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 2m33s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 33s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 8s

This commit is contained in:
2026-06-02 21:26:48 +03:00
parent 7050851bd4
commit 136bcce7db
16 changed files with 639 additions and 8 deletions
+13 -1
View File
@@ -2,6 +2,8 @@
import { computed, inject, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
import { usersApi } from '@/api'
import { downloadFile } from '@/utils/downloadFile'
import { useLecturesStore } from '@/stores/lectures'
import { useUserStore } from '@/stores/user'
import GlassCard from '@/components/ui/GlassCard.vue'
@@ -66,6 +68,16 @@ const levelProgressText = computed(() =>
: `${userXp.value} XP`,
)
async function downloadLectureIcs(id: string) {
try {
const blob = await usersApi.downloadEnrollmentIcs(id)
downloadFile(blob, `lecture-${id}.ics`)
addToast?.("Файл календаря скачан", "success")
} catch (err) {
addToast?.(err instanceof Error ? err.message : "Не удалось скачать .ics", "error")
}
}
onMounted(async () => {
await Promise.all([
lectures.all.length ? Promise.resolve() : lectures.fetchLectures(),
@@ -125,7 +137,7 @@ async function registerLecture(id: string) {
<button class="btn-primary" @click="router.push(`/lecture/${nextLecture.id}`)">
Открыть
</button>
<button class="btn-secondary">Добавить в календарь</button>
<button class="btn-secondary" @click="downloadLectureIcs(nextLecture.id)">Скачать .ics</button>
</div>
</div>
</GlassCard>