Skip to content

Commit cfbb293

Browse files
committed
fix(ashby): add missing applicationSubmit outputs, fix delete log branches
- Add candidate, currentInterviewStage, job to applicationSubmit outputs - Split delete webhook log into ok/404/error branches for accurate logging
1 parent c14fabb commit cfbb293

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

apps/sim/lib/webhooks/provider-subscriptions.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,16 +2308,20 @@ export async function deleteAshbyWebhook(webhook: any, requestId: string): Promi
23082308
body: JSON.stringify({ webhookId: externalId }),
23092309
})
23102310

2311-
if (!ashbyResponse.ok && ashbyResponse.status !== 404) {
2311+
if (ashbyResponse.ok) {
2312+
ashbyLogger.info(
2313+
`[${requestId}] Successfully deleted Ashby webhook subscription ${externalId}`
2314+
)
2315+
} else if (ashbyResponse.status === 404) {
2316+
ashbyLogger.info(
2317+
`[${requestId}] Ashby webhook ${externalId} not found during deletion (already removed)`
2318+
)
2319+
} else {
23122320
const responseBody = await ashbyResponse.json().catch(() => ({}))
23132321
ashbyLogger.warn(
23142322
`[${requestId}] Failed to delete Ashby webhook (non-fatal): ${ashbyResponse.status}`,
23152323
{ response: responseBody }
23162324
)
2317-
} else {
2318-
ashbyLogger.info(
2319-
`[${requestId}] Successfully deleted Ashby webhook subscription ${externalId}`
2320-
)
23212325
}
23222326
} catch (error) {
23232327
ashbyLogger.warn(`[${requestId}] Error deleting Ashby webhook (non-fatal)`, error)

apps/sim/triggers/ashby/utils.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ const coreOutputs = {
6666

6767
/**
6868
* Build outputs for applicationSubmit events.
69-
* Payload: { action, data: { application: { id, createdAt, updatedAt, status } } }
69+
* Payload: { action, data: { application: { id, createdAt, updatedAt, status,
70+
* candidate: { id, name }, currentInterviewStage: { id, title },
71+
* job: { id, title } } } }
7072
*/
7173
export function buildApplicationSubmitOutputs(): Record<string, TriggerOutput> {
7274
return {
@@ -82,6 +84,18 @@ export function buildApplicationSubmitOutputs(): Record<string, TriggerOutput> {
8284
type: 'string',
8385
description: 'Application status (Active, Hired, Archived, Lead)',
8486
},
87+
candidate: {
88+
id: { type: 'string', description: 'Candidate UUID' },
89+
name: { type: 'string', description: 'Candidate name' },
90+
},
91+
currentInterviewStage: {
92+
id: { type: 'string', description: 'Current interview stage UUID' },
93+
title: { type: 'string', description: 'Current interview stage title' },
94+
},
95+
job: {
96+
id: { type: 'string', description: 'Job UUID' },
97+
title: { type: 'string', description: 'Job title' },
98+
},
8599
},
86100
} as Record<string, TriggerOutput>
87101
}

0 commit comments

Comments
 (0)