Remove controller dependency
This commit is contained in:
parent
8a12523bcc
commit
89173be9f4
|
@ -1,5 +1,5 @@
|
||||||
import { InternalTables } from "../../../../db/utils"
|
import { InternalTables } from "../../../../db/utils"
|
||||||
import * as userController from "../../user"
|
|
||||||
import { context } from "@budibase/backend-core"
|
import { context } from "@budibase/backend-core"
|
||||||
import {
|
import {
|
||||||
Ctx,
|
Ctx,
|
||||||
|
@ -24,6 +24,7 @@ import {
|
||||||
import sdk from "../../../../sdk"
|
import sdk from "../../../../sdk"
|
||||||
import { processStringSync } from "@budibase/string-templates"
|
import { processStringSync } from "@budibase/string-templates"
|
||||||
import validateJs from "validate.js"
|
import validateJs from "validate.js"
|
||||||
|
import { getFullUser } from "../../../../utilities/users"
|
||||||
|
|
||||||
validateJs.extend(validateJs.validators.datetime, {
|
validateJs.extend(validateJs.validators.datetime, {
|
||||||
parse: function (value: string) {
|
parse: function (value: string) {
|
||||||
|
@ -68,11 +69,7 @@ export async function findRow(ctx: UserCtx, tableId: string, rowId: string) {
|
||||||
let row: Row
|
let row: Row
|
||||||
// TODO remove special user case in future
|
// TODO remove special user case in future
|
||||||
if (tableId === InternalTables.USER_METADATA) {
|
if (tableId === InternalTables.USER_METADATA) {
|
||||||
ctx.params = {
|
row = await getFullUser(rowId)
|
||||||
id: rowId,
|
|
||||||
}
|
|
||||||
await userController.findMetadata(ctx)
|
|
||||||
row = ctx.body
|
|
||||||
} else {
|
} else {
|
||||||
row = await db.get(rowId)
|
row = await db.get(rowId)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue