Skip to content

Commit

Permalink
Change service dialog api call to match CUI
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed May 29, 2018
1 parent c09b5ae commit 6f8d6ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions client/app/states/catalogs/details/details.state.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ function Controller ($stateParams, CollectionsApi, EventNotifications, ShoppingC
vm.parsedDialogs = dialogs.resources[0].content
}
}
setDialogUrl(vm.serviceTemplate.service_template_catalog_id)
setDialogUrl()
vm.loading = false
})
})
}

init()
function setDialogUrl (serviceTemplateCatalogId) {
vm.dialogUrl = `service_catalogs/${serviceTemplateCatalogId}/service_templates`
function setDialogUrl () {
vm.dialogUrl = `/api/service_dialogs`

return vm.dialogUrl
}
Expand All @@ -136,7 +136,7 @@ function Controller ($stateParams, CollectionsApi, EventNotifications, ShoppingC
targetId: vm.serviceTemplate.id,
targetType: 'service_template'
}
const url = `${vm.dialogUrl}/${vm.serviceTemplate.id}`
const url = `${vm.dialogUrl}/${vm.parsedDialogs.id}`
return DialogFieldRefresh.refreshDialogField(vm.dialogData, [field.name], url, idList)
}
/**
Expand Down
4 changes: 2 additions & 2 deletions client/app/states/catalogs/details/details.state.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('State: catalogs.details', () => {
it('it allows a field to be refreshed', (done) => {
controller = $controller($state.get('catalogs.details').controller)
controller.serviceTemplate = serviceTemplate
controller.setDialogUrl(serviceTemplate.service_template_catalog_id)
controller.setDialogUrl()
const refreshSpy = sinon.stub(DialogFieldRefresh, 'refreshDialogField').returns(Promise.resolve({'status': 'success'}))
const dialogData = {
'dialogField1': '1',
Expand All @@ -82,7 +82,7 @@ describe('State: catalogs.details', () => {
controller.refreshField(field).then((data) => {
done()
})
const url = `service_catalogs/${serviceTemplate.service_template_catalog_id}/service_templates/${serviceTemplate.id}`
const url = `/api/service_dialogs/${idList.dialogId}`
expect(refreshSpy).to.have.been.calledWith(dialogData, ['dialogField1'], url, idList)
})
it('allows dialog data to be updated', () => {
Expand Down

0 comments on commit 6f8d6ea

Please sign in to comment.