From 89173be9f409e46d9a0de5b67195b1343c8acb91 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 23 Jul 2024 15:03:44 +0200 Subject: [PATCH] Remove controller dependency --- packages/server/src/api/controllers/row/utils/utils.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/server/src/api/controllers/row/utils/utils.ts b/packages/server/src/api/controllers/row/utils/utils.ts index ae34034221..1a8b5c1041 100644 --- a/packages/server/src/api/controllers/row/utils/utils.ts +++ b/packages/server/src/api/controllers/row/utils/utils.ts @@ -1,5 +1,5 @@ import { InternalTables } from "../../../../db/utils" -import * as userController from "../../user" + import { context } from "@budibase/backend-core" import { Ctx, @@ -24,6 +24,7 @@ import { import sdk from "../../../../sdk" import { processStringSync } from "@budibase/string-templates" import validateJs from "validate.js" +import { getFullUser } from "../../../../utilities/users" validateJs.extend(validateJs.validators.datetime, { parse: function (value: string) { @@ -68,11 +69,7 @@ export async function findRow(ctx: UserCtx, tableId: string, rowId: string) { let row: Row // TODO remove special user case in future if (tableId === InternalTables.USER_METADATA) { - ctx.params = { - id: rowId, - } - await userController.findMetadata(ctx) - row = ctx.body + row = await getFullUser(rowId) } else { row = await db.get(rowId) }