mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-20 08:41:18 +01:00
feat: add CalDAV source config to admin dashboard (#112)
Add source definition for aelis.caldav with server URL, username, password, look-ahead days, and timezone fields. Route per-user credentials through /api/sources/:id/credentials instead of the admin provider config endpoint, controlled by a perUserCredentials flag on the source definition. Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -20,7 +20,13 @@ import {
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { Switch } from "@/components/ui/switch"
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
|
||||
import { fetchSourceConfig, pushLocation, replaceSource, updateProviderConfig } from "@/lib/api"
|
||||
import {
|
||||
fetchSourceConfig,
|
||||
pushLocation,
|
||||
replaceSource,
|
||||
updateProviderConfig,
|
||||
updateSourceCredentials,
|
||||
} from "@/lib/api"
|
||||
|
||||
interface SourceConfigPanelProps {
|
||||
source: SourceDefinition
|
||||
@@ -83,7 +89,11 @@ export function SourceConfigPanel({ source, onUpdate }: SourceConfigPanelProps)
|
||||
(v) => typeof v === "string" && v.length > 0,
|
||||
)
|
||||
if (hasCredentials) {
|
||||
promises.push(updateProviderConfig(source.id, { credentials: credentialFields }))
|
||||
if (source.perUserCredentials) {
|
||||
promises.push(updateSourceCredentials(source.id, credentialFields))
|
||||
} else {
|
||||
promises.push(updateProviderConfig(source.id, { credentials: credentialFields }))
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(promises)
|
||||
|
||||
Reference in New Issue
Block a user