-
Notifications
You must be signed in to change notification settings - Fork 35
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
[MNOE-406] Added logic to request for unscoped data when showing dashboard apps #425
base: 1.1
Are you sure you want to change the base?
Conversation
@@ -6,7 +6,7 @@ angular.module 'mnoEnterpriseAngular' | |||
@appInstances = [] | |||
|
|||
appInstancesPromise = null | |||
@getAppInstances = -> | |||
@getAppInstances = (force = false) -> |
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.
The force
is here to force unscoping?
In this case, it might more obvious to call it unscoped
? And also add a quick comment on both @getAppInstance
and @fetchAppInstance
6890d44
to
1891748
Compare
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.
Just a little style change on the Restangular call
# Workaround as the API is not standard (return a hash map not an array) | ||
# (Prefix operation by '/' to avoid data extraction) | ||
# TODO: Standard API | ||
defer = $q.defer() | ||
MnoeOrganizations.get().then( | ||
-> | ||
_self.appInstancesPromise = MnoeApiSvc.one('organizations', MnoeOrganizations.selectedId).one('/app_instances').get().then( | ||
query = if unscoped == true then '?unscoped=true' else '' | ||
_self.appInstancesPromise = MnoeApiSvc.one('organizations', MnoeOrganizations.selectedId).one('/app_instances' + query).get().then( |
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.
For query parameters, you can pass an object to get()
:
params = if unscoped then {unscoped: true} else {}
xxx.one('/app_instances').get(params)
1891748
to
18b789c
Compare
No description provided.