forked from DGNum/gestioCOF
Add websocket support to ArticleManager
This commit is contained in:
parent
565a054323
commit
fc3e86aea6
2 changed files with 6 additions and 7 deletions
|
@ -415,9 +415,10 @@ class ArticleManager {
|
|||
this.list.fromAPI({}, this.display_list.bind(this), $.noop) ;
|
||||
}
|
||||
|
||||
//TODO: filter articles before ?
|
||||
update_data(data) {
|
||||
for (let article_dict of data) {
|
||||
article = this.list.find('article', article_dict['id']);
|
||||
for (let article_dict of data.articles) {
|
||||
var article = this.list.find('article', article_dict['id']);
|
||||
|
||||
// For now, article additions are disregarded
|
||||
if (article) {
|
||||
|
|
|
@ -799,11 +799,9 @@ $(document).ready(function() {
|
|||
displayCheckoutData();
|
||||
}
|
||||
}
|
||||
for (var i=0; i<data['articles'].length; i++) {
|
||||
var article = data['articles'][i];
|
||||
articles_container.find('#data-article-'+article['id']+' .stock')
|
||||
.text(article['stock']);
|
||||
}
|
||||
|
||||
kpsul.article_manager.update_data(data);
|
||||
|
||||
if (data['addcost']) {
|
||||
Config.set('addcost_for', data['addcost']['for']);
|
||||
Config.set('addcost_amount', data['addcost']['amount']);
|
||||
|
|
Loading…
Reference in a new issue