Skip to content

Commit

Permalink
UBERF-5280: Fix backup service
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
  • Loading branch information
haiodo committed Feb 2, 2024
1 parent 69ff8dd commit d7bd733
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion server/account/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

/**
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit d7bd733

Please sign in to comment.