Check names properly
This commit is contained in:
parent
b4a979ed97
commit
1fef7838f2
|
@ -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)
|
||||
|
|
|
@ -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<RowActionResponse>(
|
||||
return await this._post<RowActionPermissionsResponse>(
|
||||
`/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<RowActionResponse>(
|
||||
return await this._delete<RowActionPermissionsResponse>(
|
||||
`/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<RowActionResponse>(
|
||||
return await this._post<RowActionPermissionsResponse>(
|
||||
`/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<RowActionResponse>(
|
||||
return await this._delete<RowActionPermissionsResponse>(
|
||||
`/api/tables/${tableId}/actions/${rowActionId}/permissions/${viewId}`,
|
||||
{
|
||||
expectations: {
|
||||
|
|
Loading…
Reference in New Issue