mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
update: work with webcal
This commit is contained in:
parent
5dce6eb89b
commit
fd81b74594
4 changed files with 40 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ const calendarRepo = require('../repositories/calendarRepo');
|
|||
const usersRepo = require('../repositories/usersRepo');
|
||||
const workflowState = require('../lib/calendarWorkflowState');
|
||||
const calendarSync = require('../services/calendarSync');
|
||||
const { normalizeIcsUrl } = require('../lib/icsUrl');
|
||||
const { requireAdmin } = require('../auth/middleware');
|
||||
const asyncHandler = require('../lib/asyncHandler');
|
||||
|
||||
|
|
@ -93,7 +94,7 @@ router.post(
|
|||
if (!icsUrl || !icsUrl.trim()) {
|
||||
return res.status(400).json({ error: 'ics_url_required' });
|
||||
}
|
||||
const trimmedUrl = icsUrl.trim();
|
||||
const trimmedUrl = normalizeIcsUrl(icsUrl.trim());
|
||||
try {
|
||||
await calendarSync.testFeed(trimmedUrl);
|
||||
} catch (err) {
|
||||
|
|
@ -148,7 +149,7 @@ router.post(
|
|||
if (!user) {
|
||||
return res.status(404).json({ error: 'user_not_found' });
|
||||
}
|
||||
const trimmedUrl = icsUrl.trim();
|
||||
const trimmedUrl = normalizeIcsUrl(icsUrl.trim());
|
||||
try {
|
||||
await calendarSync.testFeed(trimmedUrl);
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue