Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Daniel Herrero 2018-02-08 13:28:12 +01:00
commit 5ac17fe8de
4 changed files with 13 additions and 4 deletions

View File

@ -47,7 +47,7 @@ export default class Watcher extends Component {
fetchData() {
let id = this.data[this.idField];
// return new Promise((resolve, reject) => {
// return new Promise((resolve, reject) => {
this.$http.get(`${this.url}/${id}`).then(
json => {
this.data = copyObject(json.data);
@ -55,26 +55,33 @@ export default class Watcher extends Component {
}
// json => reject(json)
);
// });
// });
}
/**
* Submits the data and goes back in the history.
*
* @return {Promise} The request promise
*/
submitBack() {
return this.submit().then(
() => this.window.history.back()
);
}
/**
* Submits the data and goes another state.
*
* @param {String} state The state name
* @param {Object} params The request params
* @return {Promise} The request promise
*/
submitGo(state, params) {
return this.submit().then(
() => this.$state.go(state, params || {})
);
}
/**
* Submits the data to the server.
*

View File

@ -61,7 +61,6 @@
"karma-jasmine": "^1.1.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.9",
"md5": "^2.2.1",
"merge-stream": "^1.0.1",
"mustache": "^2.3.0",
"mysql": "^2.15.0",

View File

@ -7,7 +7,9 @@
"start": "node .",
"posttest": "npm run lint && nsp check"
},
"dependencies": {},
"dependencies": {
"md5": "^2.2.1"
},
"repository": {
"type": "git",
"url": "https://git.verdnatura.es/salix"

View File

@ -15,6 +15,7 @@
"loopback-connector-mysql": "^3.0.0",
"loopback-connector-remote": "^3.1.1",
"loopback-context": "^3.3.0",
"md5": "^2.2.1",
"serve-favicon": "^2.0.1",
"strong-error-handler": "^2.1.0"
},