Skip to content

Commit

Permalink
ULMS-1671 Added commitEdition method (dispatcher)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkonst committed Dec 15, 2021
1 parent 80d3976 commit 57b417b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ulms/api-clients",
"version": "4.12.0",
"version": "4.13.0",
"description": "JavaScript API clients for ULMS platform",
"keywords": [],
"homepage": "https://github.com/netology-group/ulms-api-clients-js#readme",
Expand Down
11 changes: 11 additions & 0 deletions src/dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ export class Dispatcher extends BasicClient {
}
}

/**
* Commit edition by scope
* @param {string} audience
* @param {string} scope
* @param {string} editionId
* @returns {Promise}
*/
commitEdition (audience, scope, editionId) {
return this._post(`${this.baseUrl}/audiences/${audience}/classes/${scope}/editions/${editionId}`)
}

/**
* Read dispatcher scope
* @param {string} kind
Expand Down
2 changes: 2 additions & 0 deletions src/http-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class FetchHttpClient {
}

return response.json()
.catch(() => response.text())
.catch(() => ({ status: response.status, statusText: response.statusText }))
}

get (url, config) {
Expand Down

0 comments on commit 57b417b

Please sign in to comment.