From 8f990725523d1ec71a0b62313f91d7789d22d6e4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 23 Oct 2024 13:08:22 +0200 Subject: [PATCH] Reuse --- packages/server/src/api/controllers/rowAction/crud.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/server/src/api/controllers/rowAction/crud.ts b/packages/server/src/api/controllers/rowAction/crud.ts index 014ebcf426..3baaff6fcc 100644 --- a/packages/server/src/api/controllers/rowAction/crud.ts +++ b/packages/server/src/api/controllers/rowAction/crud.ts @@ -30,16 +30,7 @@ export async function find(ctx: Ctx) { } const { actions } = rowActions - const automations = await sdk.automations.find( - Object.values(actions).map(({ automationId }) => automationId) - ) - const automationNames = automations.reduce>( - (names, a) => { - names[a._id] = a.name - return names - }, - {} - ) + const automationNames = await sdk.rowActions.getNames(rowActions) const result: RowActionsResponse = { actions: Object.entries(actions).reduce>( (acc, [key, action]) => ({