This commit is contained in:
2025-06-10 00:53:49 +02:00
parent 5b6f6d7071
commit 58b2504e14
4 changed files with 53 additions and 13 deletions

View File

@@ -160,14 +160,36 @@ const generateEOI = async () => {
}
};
const copyLink = (link: string | undefined) => {
const copyLink = async (link: string | undefined) => {
if (!link) return;
navigator.clipboard.writeText(link).then(() => {
try {
await navigator.clipboard.writeText(link);
showToast('Signature link copied to clipboard');
}).catch(() => {
// Update EOI Time Sent if not already set
if (!props.interest['EOI Time Sent']) {
try {
await $fetch('/api/update-interest', {
method: 'POST',
headers: {
'x-tag': '094ut234'
},
body: {
id: props.interest.Id.toString(),
data: {
'EOI Time Sent': new Date().toISOString()
}
}
});
emit('update'); // Refresh parent data
} catch (error) {
console.error('Failed to update EOI Time Sent:', error);
}
}
} catch (error) {
showToast('Failed to copy link');
});
}
};
const formatDate = (dateString: string) => {