adapt store actions
This commit is contained in:
@@ -4,9 +4,12 @@
|
||||
<h3>{{@produkt.titel}}</h3>
|
||||
<ul class="details">
|
||||
<li class="detail"><h4>Menge:</h4> {{@produkt.menge}}{{@produkt.einheit}}</li>
|
||||
<!--<li class="detail"><h4>this.ex:</h4> {{this.ex}}</li>
|
||||
<li class="detail"><h4>this.prodn:</h4> {{this.prodn}}</li>
|
||||
<li class="detail"><h4>produkt count:</h4> {{this.count}}</li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</button>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
<!--<li class="detail"><h4>this.ex:</h4> {{this.ex}}</li>
|
||||
<li class="detail"><h4>this.prodn:</h4> {{this.prodn}}</li>
|
||||
<li class="detail"><h4>produkt count:</h4> {{this.count}}</li>-->
|
||||
@@ -6,10 +6,6 @@ import { inject as service } from '@ember/service';
|
||||
export default class ProduktController extends Component {
|
||||
@tracked isLarge = false;
|
||||
@tracked isSelected = false;
|
||||
@tracked ex = false;
|
||||
@tracked isSet = false;
|
||||
@tracked prodn = "test";
|
||||
@tracked count = 0;
|
||||
|
||||
@service store;
|
||||
|
||||
@@ -26,18 +22,13 @@ export default class ProduktController extends Component {
|
||||
|
||||
@action getStatus(produktname)
|
||||
{
|
||||
this.prodn = produktname;
|
||||
|
||||
this.store.findAll('produkt')
|
||||
.then(function(suchergebnis)
|
||||
{
|
||||
|
||||
suchergebnis.forEach(element => {
|
||||
if(element.titel==produktname)
|
||||
{
|
||||
this.exists = true;
|
||||
this.isSelected = element.getStatus().isSelected;
|
||||
this.ex = true;
|
||||
this.isSelected = element.getStatus().isSelected;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -52,26 +43,13 @@ export default class ProduktController extends Component {
|
||||
{
|
||||
|
||||
//schreibt den aktuellen Zustand in den store
|
||||
let suchergebnis = this.get('store').query('produkt', {
|
||||
filter: {
|
||||
titel: produktname
|
||||
}});
|
||||
|
||||
this.prodn = suchergebnis.titel;
|
||||
|
||||
|
||||
count = suchergebnisse.titel;
|
||||
this.prodn = element.titel;
|
||||
suchergebnisse.forEach(element => {
|
||||
this.prodn = element.titel;
|
||||
count++;
|
||||
|
||||
if(element.titel === produktname)
|
||||
let suchergebnis = this.store.query('produkt', {
|
||||
filter:
|
||||
{
|
||||
this.prodn = produktname;
|
||||
element.isSelected = this.isSelected;
|
||||
this.isSet = !this.isSet;
|
||||
}
|
||||
});
|
||||
titel: produktname
|
||||
}}).then(function(element)
|
||||
{
|
||||
element.isSelected = this.isSelected;
|
||||
});;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user