Skip to content

Commit

Permalink
added fetch owner account for node
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgary committed Jun 23, 2021
1 parent 9b742c0 commit 9a80164
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gatewayapps/ims-hub-services",
"version": "0.6.3",
"version": "0.6.4",
"main": "./dist/index.js",
"publishConfig": {
"access": "public"
Expand Down
13 changes: 13 additions & 0 deletions src/fetchOwnerAccountForNode.ts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { sendHubRequest } from './request'
import { I_v_UserAccount } from './types/I_v_UserAccount'

export async function fetchOwnerAccountForNode(
nodeId: number
): Promise<I_v_UserAccount | undefined> {
const result = await sendHubRequest(`/api/hubServices/node/${nodeId}/ownerAccount`, 'GET')
if (result.success) {
return result.data
} else {
return undefined
}
}
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export { updatePackageMetadata } from './updatePackageMetadata'
export { getNodesFromPermissions } from './getNodesFromPermissions'
export { getUserFromCache, getUsersFromCache } from './userCache'
export { getNodeFromCache, getNodesFromCache } from './nodeCache'
export {UserFilterOptions, getUserAccountsRaw} from './getUserAccountsRaw'
export {fetchOwnerAccountForUserAccount} from './fetchOwnerAccountForUserAccount'
export { UserFilterOptions, getUserAccountsRaw } from './getUserAccountsRaw'
export { fetchOwnerAccountForUserAccount } from './fetchOwnerAccountForUserAccount'
export { fetchOwnerAccountForNode } from './fetchOwnerAccountForNode.ts'
/* Types */
export { I_v_NodeCache } from './types/I_v_NodeCache'
export { ICompactNode } from './types/ICompactNode'
Expand Down

0 comments on commit 9a80164

Please sign in to comment.