mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-31 04:38:02 +00:00
list accounts (#733)
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
141ca67842
commit
484ff08b05
@ -22,7 +22,8 @@ import {
|
|||||||
dropAccount,
|
dropAccount,
|
||||||
dropWorkspace,
|
dropWorkspace,
|
||||||
getAccount,
|
getAccount,
|
||||||
listWorkspaces
|
listWorkspaces,
|
||||||
|
listAccounts
|
||||||
} from '@anticrm/account'
|
} from '@anticrm/account'
|
||||||
import contact, { combineName } from '@anticrm/contact'
|
import contact, { combineName } from '@anticrm/contact'
|
||||||
import core, { TxOperations } from '@anticrm/core'
|
import core, { TxOperations } from '@anticrm/core'
|
||||||
@ -187,6 +188,16 @@ program
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('show-accounts')
|
||||||
|
.description('Show accounts')
|
||||||
|
.action(async () => {
|
||||||
|
return await withDatabase(mongodbUri, async (db) => {
|
||||||
|
const accountsJSON = JSON.stringify(await listAccounts(db), null, 2)
|
||||||
|
console.info(accountsJSON)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('drop-account <name>')
|
.command('drop-account <name>')
|
||||||
.description('drop account')
|
.description('drop account')
|
||||||
|
@ -212,6 +212,15 @@ export async function listWorkspaces (db: Db): Promise<Workspace[]> {
|
|||||||
.toArray()
|
.toArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export async function listAccounts (db: Db): Promise<Account[]> {
|
||||||
|
return await db.collection<Account>(ACCOUNT_COLLECTION)
|
||||||
|
.find({})
|
||||||
|
.toArray()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user