Fix for CI build failure.

This commit is contained in:
mike12345567 2022-12-06 18:23:55 +00:00
parent 9608b74920
commit b68c3c8481
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ export function generateUserMetadataID(globalId: string) {
/**
* Breaks up the ID to get the global ID.
*/
export function getGlobalIDFromUserMetadataID(id?: string) {
export function getGlobalIDFromUserMetadataID(id: string) {
const prefix = `${DocumentType.ROW}${SEPARATOR}${InternalTable.USER_METADATA}${SEPARATOR}`
if (!id || !id.includes(prefix)) {
return id

View File

@ -11,7 +11,7 @@ import { BBContext, User } from "@budibase/types"
function isLoggedInUser(ctx: BBContext, user: User) {
const loggedInId = ctx.user?._id
const globalUserId = dbCore.getGlobalIDFromUserMetadataID(loggedInId)
const globalUserId = dbCore.getGlobalIDFromUserMetadataID(loggedInId!)
// check both just incase
return globalUserId === user._id || loggedInId === user._id
}