Skip to content

Commit 9fd2ff0

Browse files
committed
fix(attio): always send api_slug in create list, auto-generate from name if not provided
1 parent 05419cc commit 9fd2ff0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/sim/tools/attio/create_list.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,15 @@ export const attioCreateListTool: ToolConfig<AttioCreateListParams, AttioCreateL
6565
'Content-Type': 'application/json',
6666
}),
6767
body: (params) => {
68+
const apiSlug =
69+
params.apiSlug || params.name?.toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_|_$/g, '')
6870
const data: Record<string, unknown> = {
6971
name: params.name,
72+
api_slug: apiSlug,
7073
parent_object: params.parentObject,
7174
workspace_access: params.workspaceAccess ?? null,
7275
workspace_member_access: [] as unknown[],
7376
}
74-
if (params.apiSlug) data.api_slug = params.apiSlug
7577
if (params.workspaceMemberAccess) {
7678
try {
7779
data.workspace_member_access =

0 commit comments

Comments
 (0)