From baa5a86ebb4d7983e0c31386743d1cfa0446079e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 4 Oct 2024 14:01:46 +0200 Subject: [PATCH] Rename allowedViews to allowedSources --- packages/server/src/api/controllers/rowAction/crud.ts | 10 +++++----- packages/server/src/api/routes/tests/rowAction.spec.ts | 6 +++--- packages/types/src/api/web/app/rowAction.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/server/src/api/controllers/rowAction/crud.ts b/packages/server/src/api/controllers/rowAction/crud.ts index c9b7756987..78a940c18f 100644 --- a/packages/server/src/api/controllers/rowAction/crud.ts +++ b/packages/server/src/api/controllers/rowAction/crud.ts @@ -36,7 +36,7 @@ export async function find(ctx: Ctx) { tableId: table._id!, name: action.name, automationId: action.automationId, - allowedViews: flattenAllowedViews(action.permissions.views), + allowedSources: flattenAllowedViews(action.permissions.views), }, }), {} @@ -59,7 +59,7 @@ export async function create( id: createdAction.id, name: createdAction.name, automationId: createdAction.automationId, - allowedViews: undefined, + allowedSources: undefined, } ctx.status = 201 } @@ -79,7 +79,7 @@ export async function update( id: action.id, name: action.name, automationId: action.automationId, - allowedViews: undefined, + allowedSources: undefined, } } @@ -105,7 +105,7 @@ export async function setViewPermission(ctx: Ctx) { id: action.id, name: action.name, automationId: action.automationId, - allowedViews: flattenAllowedViews(action.permissions.views), + allowedSources: flattenAllowedViews(action.permissions.views), } } @@ -124,7 +124,7 @@ export async function unsetViewPermission(ctx: Ctx) { id: action.id, name: action.name, automationId: action.automationId, - allowedViews: flattenAllowedViews(action.permissions.views), + allowedSources: flattenAllowedViews(action.permissions.views), } } diff --git a/packages/server/src/api/routes/tests/rowAction.spec.ts b/packages/server/src/api/routes/tests/rowAction.spec.ts index 4fe248984a..7c1d88cc65 100644 --- a/packages/server/src/api/routes/tests/rowAction.spec.ts +++ b/packages/server/src/api/routes/tests/rowAction.spec.ts @@ -576,10 +576,10 @@ describe("/rowsActions", () => { ) const expectedAction1 = expect.objectContaining({ - allowedViews: [viewId1, viewId2], + allowedSources: [viewId1, viewId2], }) const expectedAction2 = expect.objectContaining({ - allowedViews: [viewId1], + allowedSources: [viewId1], }) const expectedActions = expect.objectContaining({ @@ -601,7 +601,7 @@ describe("/rowsActions", () => { ) const expectedAction = expect.objectContaining({ - allowedViews: [viewId2], + allowedSources: [viewId2], }) expect(actionResult).toEqual(expectedAction) expect( diff --git a/packages/types/src/api/web/app/rowAction.ts b/packages/types/src/api/web/app/rowAction.ts index 37cfaf0fbd..0061be275e 100644 --- a/packages/types/src/api/web/app/rowAction.ts +++ b/packages/types/src/api/web/app/rowAction.ts @@ -8,7 +8,7 @@ export interface RowActionResponse extends RowActionData { id: string tableId: string automationId: string - allowedViews: string[] | undefined + allowedSources: string[] | undefined } export interface RowActionsResponse {