diff --git a/packages/server/src/sdk/app/rowActions.ts b/packages/server/src/sdk/app/rowActions.ts index d5c7666edb..6a0a803bd5 100644 --- a/packages/server/src/sdk/app/rowActions.ts +++ b/packages/server/src/sdk/app/rowActions.ts @@ -23,7 +23,8 @@ async function ensureUniqueAndThrow( if ( Object.entries(names).find( - ([id, name]) => name === name && id !== existingRowActionId + ([automationId, automationName]) => + automationName === name && automationId !== existingRowActionId ) ) { throw new HTTPError("A row action with the same name already exists.", 409) diff --git a/packages/server/src/tests/utilities/api/rowAction.ts b/packages/server/src/tests/utilities/api/rowAction.ts index 0fd5936257..e18f2ce6b6 100644 --- a/packages/server/src/tests/utilities/api/rowAction.ts +++ b/packages/server/src/tests/utilities/api/rowAction.ts @@ -1,5 +1,6 @@ import { CreateRowActionRequest, + RowActionPermissionsResponse, RowActionResponse, RowActionsResponse, RowActionTriggerRequest, @@ -78,7 +79,7 @@ export class RowActionAPI extends TestAPI { expectations?: Expectations, config?: { publicUser?: boolean } ) => { - return await this._post( + return await this._post( `/api/tables/${tableId}/actions/${rowActionId}/permissions`, { expectations: { @@ -96,7 +97,7 @@ export class RowActionAPI extends TestAPI { expectations?: Expectations, config?: { publicUser?: boolean } ) => { - return await this._delete( + return await this._delete( `/api/tables/${tableId}/actions/${rowActionId}/permissions`, { expectations: { @@ -115,7 +116,7 @@ export class RowActionAPI extends TestAPI { expectations?: Expectations, config?: { publicUser?: boolean } ) => { - return await this._post( + return await this._post( `/api/tables/${tableId}/actions/${rowActionId}/permissions/${viewId}`, { expectations: { @@ -134,7 +135,7 @@ export class RowActionAPI extends TestAPI { expectations?: Expectations, config?: { publicUser?: boolean } ) => { - return await this._delete( + return await this._delete( `/api/tables/${tableId}/actions/${rowActionId}/permissions/${viewId}`, { expectations: {