UBERF-5280: Fix backup service ()

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-02-03 17:50:10 +07:00 committed by GitHub
parent 69ff8dd4c7
commit a036f24856
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions
.github/workflows
server/account/src

View File

@ -277,7 +277,7 @@ jobs:
env:
DOCKER_CLI_HINTS: false
- name: Login to Docker Hub
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
uses: docker/login-action@v3
with:
username: hardcoreeng

View File

@ -581,7 +581,7 @@ export async function listWorkspaces (db: Db, productId: string): Promise<Client
return (await db.collection<Workspace>(WORKSPACE_COLLECTION).find(withProductId(productId, {})).toArray())
.map((it) => ({ ...it, productId }))
.filter((it) => it.disabled !== true)
.map(mapToClientWorkspace)
.map(trimWorkspaceInfo)
}
/**
@ -875,11 +875,21 @@ export async function getInviteLink (
*/
export type ClientWorkspaceInfo = Omit<Workspace, '_id' | 'accounts' | 'workspaceUrl'>
/**
* @public
*/
export type WorkspaceInfo = Omit<Workspace, '_id' | 'accounts' | 'workspaceUrl'>
function mapToClientWorkspace (ws: Workspace): ClientWorkspaceInfo {
const { _id, accounts, ...data } = ws
return { ...data, workspace: ws.workspaceUrl ?? ws.workspace }
}
function trimWorkspaceInfo (ws: Workspace): WorkspaceInfo {
const { _id, accounts, ...data } = ws
return { ...data }
}
/**
* @public
*/