|
|
|
|
@ -21,6 +21,7 @@
|
|
|
|
|
if (type === 'group' && groupId) rotating[groupId] = true;
|
|
|
|
|
if (type === 'personal') rotating['personal'] = true;
|
|
|
|
|
if (type === 'aggregate') rotating['aggregate'] = true;
|
|
|
|
|
rotating = { ...rotating };
|
|
|
|
|
|
|
|
|
|
const res = await fetch('/api/integrations/feeds/rotate', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
@ -28,8 +29,7 @@
|
|
|
|
|
body: JSON.stringify({ type, groupId: groupId ?? null })
|
|
|
|
|
});
|
|
|
|
|
if (!res.ok) {
|
|
|
|
|
const msg = await res.text();
|
|
|
|
|
error(`No se pudo rotar: ${msg || res.status}`);
|
|
|
|
|
error('No se puedo actualizar');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const body = await res.json();
|
|
|
|
|
@ -41,13 +41,14 @@
|
|
|
|
|
const idx = groups.findIndex(g => g.groupId === groupId);
|
|
|
|
|
if (idx >= 0) groups[idx].url = body.url || null;
|
|
|
|
|
}
|
|
|
|
|
success('Token rotado correctamente');
|
|
|
|
|
success('Feed de calendario actualizado');
|
|
|
|
|
} catch (e) {
|
|
|
|
|
error('Error al rotar el token');
|
|
|
|
|
error('No se puedo actualizar');
|
|
|
|
|
} finally {
|
|
|
|
|
if (type === 'group' && groupId) rotating[groupId] = false;
|
|
|
|
|
if (type === 'personal') rotating['personal'] = false;
|
|
|
|
|
if (type === 'aggregate') rotating['aggregate'] = false;
|
|
|
|
|
rotating = { ...rotating };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|