[webpack.ue.view] fixed update
This commit is contained in:
parent
fa9964cd78
commit
fc26d4a7ef
|
@ -403,7 +403,7 @@ gstore.add('ie_handler', function(ue_i){
|
||||||
( vco != ue.volumeCours ) && ( rq.volumeCours = parseInt(vco) );
|
( vco != ue.volumeCours ) && ( rq.volumeCours = parseInt(vco) );
|
||||||
( vtd != ue.volumeTD ) && ( rq.volumeTD = parseInt(vtd) );
|
( vtd != ue.volumeTD ) && ( rq.volumeTD = parseInt(vtd) );
|
||||||
( vtp != ue.volumeTP ) && ( rq.volumeTP = parseInt(vtp) );
|
( vtp != ue.volumeTP ) && ( rq.volumeTP = parseInt(vtp) );
|
||||||
( form != ue.defaultFormation ) && ( rq.defaultFormation = parseInt(form) );
|
( form != ue.idForm ) && ( rq.defaultFormation = parseInt(form) );
|
||||||
|
|
||||||
(new Promise( (resolve, reject) => {
|
(new Promise( (resolve, reject) => {
|
||||||
|
|
||||||
|
@ -423,6 +423,7 @@ gstore.add('ie_handler', function(ue_i){
|
||||||
api.call(`PUT ue/${ue.code}`, rq, function(rs){
|
api.call(`PUT ue/${ue.code}`, rq, function(rs){
|
||||||
|
|
||||||
/* (5.8.1.1) Abort on error */
|
/* (5.8.1.1) Abort on error */
|
||||||
|
console.log(rq, rs.error != 0, rs.updated != true);
|
||||||
if( rs.error != 0 || rs.updated != true )
|
if( rs.error != 0 || rs.updated != true )
|
||||||
return reject(rs.error);
|
return reject(rs.error);
|
||||||
|
|
||||||
|
@ -438,7 +439,7 @@ gstore.add('ie_handler', function(ue_i){
|
||||||
|
|
||||||
/* (5.9.1) update VueJS element */
|
/* (5.9.1) update VueJS element */
|
||||||
gstore.get.ues[ue_i].label = label;
|
gstore.get.ues[ue_i].label = label;
|
||||||
gstore.get.ues[ue_i].code = code;
|
// gstore.get.ues[ue_i].code = code;
|
||||||
gstore.get.ues[ue_i].idForm = parseInt(form);
|
gstore.get.ues[ue_i].idForm = parseInt(form);
|
||||||
gstore.get.ues[ue_i].volumeCours = parseInt(vco);
|
gstore.get.ues[ue_i].volumeCours = parseInt(vco);
|
||||||
gstore.get.ues[ue_i].volumeTD = parseInt(vtd);
|
gstore.get.ues[ue_i].volumeTD = parseInt(vtd);
|
||||||
|
@ -448,9 +449,15 @@ gstore.add('ie_handler', function(ue_i){
|
||||||
var fi = gstore.get.formations.map( (data, i) => { return ( data.idForm && data.idForm == form ) ? i : ''; }).join('');
|
var fi = gstore.get.formations.map( (data, i) => { return ( data.idForm && data.idForm == form ) ? i : ''; }).join('');
|
||||||
|
|
||||||
/* (5.9.3) Exit if not found */
|
/* (5.9.3) Exit if not found */
|
||||||
if( isNaN(fi) ) return gstore.add('edit_i', -1);
|
if( isNaN(fi) )
|
||||||
|
return gstore.add('edit_i', -1);
|
||||||
|
|
||||||
/* (5.9.4) If found -> set formation label */
|
/* (5.9.4) If not found -> set default text */
|
||||||
|
if( !gstore.get.formations.hasOwnProperty(fi) )
|
||||||
|
gstore.get.ues[ue_i].labelForm = '';
|
||||||
|
|
||||||
|
/* (5.9.5) If found -> set formation label */
|
||||||
|
else
|
||||||
gstore.get.ues[ue_i].labelForm = gstore.get.formations[fi].labelForm;
|
gstore.get.ues[ue_i].labelForm = gstore.get.formations[fi].labelForm;
|
||||||
|
|
||||||
/* (5.9.5) Remove edit mode */
|
/* (5.9.5) Remove edit mode */
|
||||||
|
|
Loading…
Reference in New Issue