Remove unnecessary row action update endpoint
This commit is contained in:
parent
1f01277ee8
commit
076f21108f
|
@ -68,26 +68,6 @@ export async function create(
|
|||
ctx.status = 201
|
||||
}
|
||||
|
||||
export async function update(
|
||||
ctx: Ctx<UpdateRowActionRequest, RowActionResponse>
|
||||
) {
|
||||
const table = await getTable(ctx)
|
||||
const tableId = table._id!
|
||||
const { actionId } = ctx.params
|
||||
|
||||
const action = await sdk.rowActions.update(tableId, actionId, {
|
||||
name: ctx.request.body.name,
|
||||
})
|
||||
|
||||
ctx.body = {
|
||||
tableId,
|
||||
id: action.id,
|
||||
name: action.name,
|
||||
automationId: action.automationId,
|
||||
allowedSources: flattenAllowedSources(tableId, action.permissions),
|
||||
}
|
||||
}
|
||||
|
||||
export async function remove(ctx: Ctx<void, void>) {
|
||||
const table = await getTable(ctx)
|
||||
const { actionId } = ctx.params
|
||||
|
|
|
@ -40,12 +40,6 @@ router
|
|||
rowActionValidator(),
|
||||
rowActionController.create
|
||||
)
|
||||
.put(
|
||||
"/api/tables/:tableId/actions/:actionId",
|
||||
authorized(BUILDER),
|
||||
rowActionValidator(),
|
||||
rowActionController.update
|
||||
)
|
||||
.delete(
|
||||
"/api/tables/:tableId/actions/:actionId",
|
||||
authorized(BUILDER),
|
||||
|
|
|
@ -159,20 +159,6 @@ async function updateDoc(
|
|||
}
|
||||
}
|
||||
|
||||
export async function update(
|
||||
tableId: string,
|
||||
rowActionId: string,
|
||||
rowActionData: { name: string }
|
||||
) {
|
||||
const newName = rowActionData.name.trim()
|
||||
|
||||
return await updateDoc(tableId, rowActionId, actionsDoc => {
|
||||
ensureUniqueAndThrow(actionsDoc, newName, rowActionId)
|
||||
actionsDoc.actions[rowActionId].name = newName
|
||||
return actionsDoc
|
||||
})
|
||||
}
|
||||
|
||||
async function guardView(tableId: string, viewId: string) {
|
||||
let view
|
||||
if (docIds.isViewId(viewId)) {
|
||||
|
|
Loading…
Reference in New Issue