diff --git a/app/carnet/page.tsx b/app/carnet/page.tsx index 976ece65..f187549f 100644 --- a/app/carnet/page.tsx +++ b/app/carnet/page.tsx @@ -494,7 +494,10 @@ export default function CarnetPage() { setIsLoading(true); const vcardContent = generateVCard(contact); const filename = `${contact.id}.vcf`; - const path = `/files/cube-${session.user.id}/Private/Contacts/${selectedFolder}/${filename}`; + + // If we're in a specific group folder, use that as the path + const folderPath = selectedFolder === 'Contacts' ? 'Contacts' : `Contacts/${selectedFolder}`; + const path = `/files/cube-${session.user.id}/Private/${folderPath}/${filename}`; const response = await fetch('/api/nextcloud/files', { method: 'PUT', @@ -505,7 +508,7 @@ export default function CarnetPage() { id: path, title: filename, content: vcardContent, - folder: `Contacts/${selectedFolder}`, + folder: folderPath }), });