PR comments.
This commit is contained in:
parent
467bdcf74c
commit
1b15ef3b7e
|
@ -2,7 +2,7 @@ import { outputProcessing } from "../../utilities/rowProcessor"
|
||||||
import { InternalTables } from "../../db/utils"
|
import { InternalTables } from "../../db/utils"
|
||||||
import { getFullUser } from "../../utilities/users"
|
import { getFullUser } from "../../utilities/users"
|
||||||
import { roles, context, db as dbCore } from "@budibase/backend-core"
|
import { roles, context, db as dbCore } from "@budibase/backend-core"
|
||||||
import { AppSelfResponse, ContextUser, Row, UserCtx } from "@budibase/types"
|
import { AppSelfResponse, ContextUser, UserCtx } from "@budibase/types"
|
||||||
import sdk from "../../sdk"
|
import sdk from "../../sdk"
|
||||||
import { processUser } from "../../utilities/global"
|
import { processUser } from "../../utilities/global"
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ export async function fetchSelf(ctx: UserCtx<void, AppSelfResponse>) {
|
||||||
try {
|
try {
|
||||||
const userTable = await sdk.tables.getTable(InternalTables.USER_METADATA)
|
const userTable = await sdk.tables.getTable(InternalTables.USER_METADATA)
|
||||||
// specifically needs to make sure is enriched
|
// specifically needs to make sure is enriched
|
||||||
ctx.body = (await outputProcessing(userTable, user as Row)) as ContextUser
|
ctx.body = await outputProcessing(userTable, user)
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
let response: ContextUser | {}
|
let response: ContextUser | {}
|
||||||
// user didn't exist in app, don't pretend they do
|
// user didn't exist in app, don't pretend they do
|
||||||
|
|
|
@ -126,6 +126,9 @@ export async function deploymentProgress(
|
||||||
try {
|
try {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const deploymentDoc = await db.get<DeploymentDoc>(DocumentType.DEPLOYMENTS)
|
const deploymentDoc = await db.get<DeploymentDoc>(DocumentType.DEPLOYMENTS)
|
||||||
|
if (!deploymentDoc.history?.[ctx.params.deploymentId]) {
|
||||||
|
ctx.throw(404, "No deployment found")
|
||||||
|
}
|
||||||
ctx.body = deploymentDoc.history?.[ctx.params.deploymentId]
|
ctx.body = deploymentDoc.history?.[ctx.params.deploymentId]
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ctx.throw(
|
ctx.throw(
|
||||||
|
|
|
@ -2,13 +2,11 @@ import { DeploymentDoc, DeploymentStatus } from "../../documents"
|
||||||
|
|
||||||
export interface PublishAppResponse extends DeploymentDoc {}
|
export interface PublishAppResponse extends DeploymentDoc {}
|
||||||
|
|
||||||
export type DeploymentProgressResponse =
|
export interface DeploymentProgressResponse {
|
||||||
| {
|
_id: string
|
||||||
_id: string
|
appId: string
|
||||||
appId: string
|
status?: DeploymentStatus
|
||||||
status?: DeploymentStatus
|
updatedAt: number
|
||||||
updatedAt: number
|
}
|
||||||
}
|
|
||||||
| undefined
|
|
||||||
|
|
||||||
export type FetchDeploymentResponse = DeploymentProgressResponse[]
|
export type FetchDeploymentResponse = DeploymentProgressResponse[]
|
||||||
|
|
Loading…
Reference in New Issue