Skip to content
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

Open
wants to merge 3 commits into
base: 1.1
Choose a base branch
from

Conversation

MAhsenArif
Copy link
Contributor

No description provided.

@@ -6,7 +6,7 @@ angular.module 'mnoEnterpriseAngular'
@appInstances = []

appInstancesPromise = null
@getAppInstances = ->
@getAppInstances = (force = false) ->
Copy link
Contributor

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

Copy link
Contributor

@ouranos ouranos left a 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(
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants