Rename allowedViews to allowedSources
This commit is contained in:
parent
c2358a6d6d
commit
baa5a86ebb
|
@ -36,7 +36,7 @@ export async function find(ctx: Ctx<void, RowActionsResponse>) {
|
|||
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<void, RowActionResponse>) {
|
|||
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<void, RowActionResponse>) {
|
|||
id: action.id,
|
||||
name: action.name,
|
||||
automationId: action.automationId,
|
||||
allowedViews: flattenAllowedViews(action.permissions.views),
|
||||
allowedSources: flattenAllowedViews(action.permissions.views),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -8,7 +8,7 @@ export interface RowActionResponse extends RowActionData {
|
|||
id: string
|
||||
tableId: string
|
||||
automationId: string
|
||||
allowedViews: string[] | undefined
|
||||
allowedSources: string[] | undefined
|
||||
}
|
||||
|
||||
export interface RowActionsResponse {
|
||||
|
|
Loading…
Reference in New Issue