fix: update contact URL structure for Radicale sync functions
This commit is contained in:
@@ -155,7 +155,7 @@ async function syncContactToRadicaleInternal(contact, forceUpdate = false) {
|
|||||||
const baseUrl = config.url.endsWith('/') ? config.url : config.url + '/';
|
const baseUrl = config.url.endsWith('/') ? config.url : config.url + '/';
|
||||||
|
|
||||||
// Construct the URL for this specific contact
|
// Construct the URL for this specific contact
|
||||||
const vcardUrl = `${baseUrl}${config.username}/contacts/contact-${contact.contact_id}.vcf`;
|
const vcardUrl = `${baseUrl}${config.username}/b576a569-4af7-5812-7ddd-3c7cb8caf692/contact-${contact.contact_id}.vcf`;
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
'Authorization': `Basic ${auth}`,
|
'Authorization': `Basic ${auth}`,
|
||||||
@@ -235,7 +235,7 @@ export async function deleteContactFromRadicale(contactId) {
|
|||||||
const baseUrl = config.url.endsWith('/') ? config.url : config.url + '/';
|
const baseUrl = config.url.endsWith('/') ? config.url : config.url + '/';
|
||||||
|
|
||||||
// Construct the URL for this specific contact
|
// Construct the URL for this specific contact
|
||||||
const vcardUrl = `${baseUrl}${config.username}/contacts/contact-${contactId}.vcf`;
|
const vcardUrl = `${baseUrl}${config.username}/b576a569-4af7-5812-7ddd-3c7cb8caf692/contact-${contactId}.vcf`;
|
||||||
|
|
||||||
const response = await fetch(vcardUrl, {
|
const response = await fetch(vcardUrl, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
@@ -260,7 +260,6 @@ export async function deleteContactFromRadicale(contactId) {
|
|||||||
|
|
||||||
// Sync contact asynchronously (fire and forget)
|
// Sync contact asynchronously (fire and forget)
|
||||||
export function syncContactAsync(contact) {
|
export function syncContactAsync(contact) {
|
||||||
console.log(contact, isRadicaleEnabled());
|
|
||||||
if (!isRadicaleEnabled()) {
|
if (!isRadicaleEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user