Skip to content

Commit 972daa4

Browse files
committed
fix(grain): add grain key to idempotency service
1 parent 833825f commit 972daa4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ function extractAirtableIdentifier(body: any): string | null {
6363
return null
6464
}
6565

66+
function extractGrainIdentifier(body: any): string | null {
67+
if (body.type && body.data?.id) {
68+
return `${body.type}:${body.data.id}`
69+
}
70+
return null
71+
}
72+
6673
const PROVIDER_EXTRACTORS: Record<string, (body: any) => string | null> = {
6774
slack: extractSlackIdentifier,
6875
twilio: extractTwilioIdentifier,
@@ -73,6 +80,7 @@ const PROVIDER_EXTRACTORS: Record<string, (body: any) => string | null> = {
7380
jira: extractJiraIdentifier,
7481
'microsoft-teams': extractMicrosoftTeamsIdentifier,
7582
airtable: extractAirtableIdentifier,
83+
grain: extractGrainIdentifier,
7684
}
7785

7886
export function extractProviderIdentifierFromBody(provider: string, body: any): string | null {

0 commit comments

Comments
 (0)