-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor/client types #2025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/client types #2025
Changes from 1 commit
9e5092a
f12cad7
aa2741d
60d3bb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,7 +100,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use | |
/** | ||
* Gets all available info on a user | ||
* | ||
* @param {Function} [callback] - funciton(user) | ||
* @param {Function} [callback] - optional, function(user) | ||
* @return {Promise} | ||
*/ | ||
getCurrentUser(callback) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't the fix be to say There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's a more informative type definition for it. Was not sure it was valid Flow syntax as well but it does appear to be. Examples or documentation of each for reference: Flow documentation TS example. Should probably change all the other async functions then in auth.service as I kinda only copied documentation from them while all of them use the same Will just do it now. |
||
|
@@ -134,7 +134,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use | |
* @return {Bool|Promise} | ||
*/ | ||
isLoggedIn(callback) { | ||
return Auth.getCurrentUser() | ||
return Auth.getCurrentUser(undefined) | ||
.then(user => { | ||
var is = user.hasOwnProperty('role'); | ||
safeCb(callback)(is); | ||
|
@@ -159,7 +159,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use | |
* @return {Bool|Promise} | ||
*/ | ||
hasRole(role, callback) { | ||
return Auth.getCurrentUser() | ||
return Auth.getCurrentUser(undefined) | ||
.then(user => { | ||
var has = user.hasOwnProperty('role') | ||
? hasRole(user.role, role) | ||
|
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.
"optional, " is redundant here