-
Notifications
You must be signed in to change notification settings - Fork 19
Conversation
It's because in udaru-core the related methods are structured like this.
Now, Since your callback has a single argument you can follow one of these two solutions:
const result = {
page: page,
limit: pageSize,
total: job.totalPoliciesCount,
data: job.organization.policies
}
return cb(null, result) to this: if (typeof cb !== 'function') [promise, cb] = asyncify('data', 'total', 'page', 'limit')
// ...
return cb(null, job.organization.policies, job.totalPoliciesCount, page, pageSize) Good luck! ^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it looks good to me.
Once you fix the misunderstading you requested information for, you're good to go!
@ShogunPanda, I completely blindspotted that... thanks! Should we explicity handle errors e.g. 404 not found in hapi endpoints? I'm just using await on the test if user/team exists, which will throw the error just wondering is that preferred approach or should it be in try catch? |
@ShogunPanda, core and tests updated there now... thanks again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @cianfoley-nearform
Hi @mihaidma
I've added the GET policy endpoints to users, teams and orgs, tests in place updated swagger etc.
#461
@ShogunPanda, one thing is confusing me in the hapi17 tests, I might be doing something silly but in org and user I have to check against result.data.data instead of result.data like in teams...
@dberesford