Remove unnecessary row action update endpoint

This commit is contained in:
Adria Navarro 2024-10-23 12:30:23 +02:00
parent 1f01277ee8
commit 076f21108f
3 changed files with 0 additions and 40 deletions

View File

@ -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

View File

@ -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),

View File

@ -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)) {