feat(05-07): cloud connections Pinia store + API client functions

- Create useCloudConnectionsStore with connections/loading/error refs
- fetchConnections, disconnect(id), disconnectAll() actions
- Append listCloudConnections, disconnectCloud, connectWebDav, updateDefaultStorage to api/client.js
- Add vitest test script to package.json
- 4 unit tests passing (W4 — CLAUDE.md)
This commit is contained in:
curo1305
2026-05-29 08:05:59 +02:00
parent c44e861271
commit 612d542c06
4 changed files with 126 additions and 1 deletions
+26
View File
@@ -364,3 +364,29 @@ export function adminListAuditLog({ start, end, user_id, event_type, page = 1, p
export function getDocumentContentUrl(docId) {
return `/api/documents/${docId}/content`
}
// ── Cloud Storage ─────────────────────────────────────────────────────────────
export function listCloudConnections() {
return request('/api/cloud/connections')
}
export function disconnectCloud(id) {
return request(`/api/cloud/connections/${id}`, { method: 'DELETE' })
}
export function connectWebDav(provider, serverUrl, username, password) {
return request('/api/cloud/connections/webdav', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ provider, server_url: serverUrl, username, password }),
})
}
export function updateDefaultStorage(backend) {
return request('/api/users/me/default-storage', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ backend }),
})
}