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:
@@ -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 }),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user