feat(06.2-02): frontend — is_shared badge fix + permission dropdown + View/Edit toggle
- DocumentCard.vue: fix Shared pill to read doc.is_shared (was doc.share_count > 0) - ShareModal.vue: add permission select between handle input and submit button - ShareModal.vue: replace static "view" span with View/Edit toggle group per share row - ShareModal.vue: add handlePermissionChange with optimistic update + rollback on error - documents.js: update shareDocument(docId, handle, permission='view') signature - documents.js: add updateSharePermission(shareId, permission) action - api/client.js: pass permission in createShare POST body - api/client.js: add updateSharePermission PATCH helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -328,11 +328,19 @@ export function moveDocument(docId, folderId) {
|
||||
|
||||
// ── Shares ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export function createShare(docId, recipientHandle) {
|
||||
export function createShare(docId, recipientHandle, permission = 'view') {
|
||||
return request('/api/shares', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ document_id: docId, recipient_handle: recipientHandle }),
|
||||
body: JSON.stringify({ document_id: docId, recipient_handle: recipientHandle, permission }),
|
||||
})
|
||||
}
|
||||
|
||||
export function updateSharePermission(shareId, permission) {
|
||||
return request(`/api/shares/${shareId}`, {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ permission }),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user