FEAT: Correct spelling of 'Documenso' in API utility functions and add connectivity test for Documenso API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getDocumesoDocumentByExternalId, checkDocumentSignatureStatus } from '~/server/utils/documeso';
|
||||
import { getDocumensoDocumentByExternalId, checkDocumentSignatureStatus } from '~/server/utils/documeso';
|
||||
import { getInterestById, updateInterest } from '~/server/utils/nocodb';
|
||||
import { requireAuth } from '~/server/utils/auth';
|
||||
import type { InterestSalesProcessLevel, EOIStatus } from '~/utils/types';
|
||||
@@ -89,7 +89,7 @@ export default defineEventHandler(async (event) => {
|
||||
// Otherwise, try to find by external ID (using interestId) - fallback method
|
||||
console.log('[check-signature-status] No documensoID stored, trying external ID fallback');
|
||||
const externalId = `loi-${interestId}`;
|
||||
const document = await getDocumesoDocumentByExternalId(externalId);
|
||||
const document = await getDocumensoDocumentByExternalId(externalId);
|
||||
|
||||
if (!document) {
|
||||
console.log('[check-signature-status] No document found by external ID either');
|
||||
|
||||
@@ -55,8 +55,13 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('[Delete Generated EOI] Failed to check signature status:', error);
|
||||
// If we can't check status, we'll proceed with deletion but warn
|
||||
console.warn('[Delete Generated EOI] Proceeding with deletion despite signature status check failure');
|
||||
|
||||
// If it's a 404 error, the document is already gone from Documenso, so we can proceed with cleanup
|
||||
if (error.status === 404 || error.statusCode === 404 || error.message?.includes('404')) {
|
||||
console.log('[Delete Generated EOI] Document not found in Documenso (404) - proceeding with database cleanup');
|
||||
} else {
|
||||
console.warn('[Delete Generated EOI] Proceeding with deletion despite signature status check failure');
|
||||
}
|
||||
}
|
||||
|
||||
// Delete document from Documenso
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { requireAuth } from '~/server/utils/auth';
|
||||
import { getDocumesoDocument, checkDocumentSignatureStatus, formatRecipientName } from '~/server/utils/documeso';
|
||||
import { getDocumensoDocument, checkDocumentSignatureStatus, formatRecipientName } from '~/server/utils/documeso';
|
||||
import { getInterestById } from '~/server/utils/nocodb';
|
||||
import { sendEmail } from '~/server/utils/email';
|
||||
|
||||
@@ -45,7 +45,7 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
// Get document and check signature status
|
||||
const document = await getDocumesoDocument(parseInt(documentId));
|
||||
const document = await getDocumensoDocument(parseInt(documentId));
|
||||
const status = await checkDocumentSignatureStatus(parseInt(documentId));
|
||||
|
||||
const emailsToSend: ReminderEmail[] = [];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getInterestById, updateInterest } from '~/server/utils/nocodb';
|
||||
import { getDocumesoDocument } from '~/server/utils/documeso';
|
||||
import { getDocumensoDocument } from '~/server/utils/documeso';
|
||||
import { requireAuth } from '~/server/utils/auth';
|
||||
import type { InterestSalesProcessLevel, EOIStatus } from '~/utils/types';
|
||||
|
||||
@@ -52,7 +52,7 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
try {
|
||||
console.log('[Validate Document] Checking document existence in Documenso');
|
||||
const document = await getDocumesoDocument(parseInt(documensoID));
|
||||
const document = await getDocumensoDocument(parseInt(documensoID));
|
||||
documentStatus = document.status;
|
||||
console.log('[Validate Document] Document exists with status:', documentStatus);
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user