Skip to content

Commit f4a2fbd

Browse files
Update apps/webapp/app/services/attio.server.ts
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent e0af6a8 commit f4a2fbd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/webapp/app/services/attio.server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ class AttioClient {
4747
throw new Error(`Attio assert ${object} failed with status ${response.status}`);
4848
}
4949

50-
return ((await response.json()) as any).data?.id?.record_id as string;
50+
const recordId = ((await response.json()) as any).data?.id?.record_id;
51+
if (typeof recordId !== "string") {
52+
throw new Error(`Attio assert ${object}: response missing data.id.record_id`);
53+
}
54+
return recordId;
5155
}
5256

5357
async upsertWorkspace(payload: AttioWorkspaceSync, emailDomain?: string) {

0 commit comments

Comments
 (0)