Remove controller dependency

This commit is contained in:
Adria Navarro 2024-07-23 15:03:44 +02:00
parent 8a12523bcc
commit 89173be9f4
1 changed files with 3 additions and 6 deletions

View File

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