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

Fix/Clear Api Data with all server response #909

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions js/Release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Release note

### version 1.12.2 (2020-02-04)

- Fix https://github.com/atk4/ui/issues/902
Throwing error on server was not clearing api.data object, thus keeping
old value with new server request. This fix make sure api.data gets clear
on all server response, successful or not.

### version 1.12.1 (2020-01-14)

- update api service to generate modals in json request.
Expand Down
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atkjs-ui",
"version": "1.12.1",
"version": "1.12.2",
"description": "Agile Toolkit Javascript library.",
"main": "lib/atkjs-ui.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions js/src/services/api.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ class ApiService {
}

/**
* Check server response
* Check server response and clear api.data object.
* - return true will call onSuccess
* - return false will call onFailure
* @param response
* @returns {boolean}
*/
successTest(response) {
this.data = {};
if (response.success) {
this.data = {};
return true;
} else {
return false;
Expand Down