-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gro 738 refactor code that returns the account holder from user (#14872)
* WIP * WIP * Remove tests * Remove TenantInfo * Remove unused export * Remove TenantInfo type * Remove unused export * Remove unused routes * Add getAccountHolder front-end endpoint * Add endpoint to no tenancy list * Get account holder via appId * lint * Update pro ref * Use account email instead of budibaseUserId (#14876) * Update account-portal ref * Update account portal ref * Correct import order * Simplify boolean * type fix * Rename endpoint to accountholder * Update account-portal ref * Refactor * Refactor to not use appId * Update type * appId not needed * Unused import
- Loading branch information
Showing
25 changed files
with
126 additions
and
256 deletions.
There are no files selected for viewing
Submodule account-portal
updated
from 8cd052 to 607e3d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,6 @@ | ||
import { getDB } from "../db/db" | ||
import { getGlobalDBName } from "../context" | ||
import { TenantInfo } from "@budibase/types" | ||
|
||
export function getTenantDB(tenantId: string) { | ||
return getDB(getGlobalDBName(tenantId)) | ||
} | ||
|
||
export async function saveTenantInfo(tenantInfo: TenantInfo) { | ||
const db = getTenantDB(tenantInfo.tenantId) | ||
// save the tenant info to db | ||
return db.put({ | ||
_id: "tenant_info", | ||
...tenantInfo, | ||
}) | ||
} | ||
|
||
export async function getTenantInfo( | ||
tenantId: string | ||
): Promise<TenantInfo | undefined> { | ||
try { | ||
const db = getTenantDB(tenantId) | ||
const tenantInfo = (await db.get("tenant_info")) as TenantInfo | ||
delete tenantInfo.owner.password | ||
return tenantInfo | ||
} catch { | ||
return undefined | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.