small fixes
This commit is contained in:
@@ -127,8 +127,6 @@ mod api {
|
||||
solver::{Domain, Problem}
|
||||
};
|
||||
|
||||
println!("{:?}", partial);
|
||||
println!("Building problem");
|
||||
let possible_values = recipes::load_all(&conn);
|
||||
let domain = Domain::new(possible_values);
|
||||
let mut problem = Problem::build();
|
||||
@@ -144,16 +142,15 @@ mod api {
|
||||
&& slot.key.1 == format!("{:?}",var.1)
|
||||
{
|
||||
let id = slot.value.as_ref().unwrap().id;
|
||||
println!("found initial : recipe with id {}", id);
|
||||
//println!("found initial : recipe with id {}", id);
|
||||
Some(id)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
let ini = if let Some(id) = initial_id {
|
||||
// Not working because we're capturing `id`
|
||||
let new_ini = domain.find(|r| {r.id == id});
|
||||
println!("Overrided {:?}", new_ini);
|
||||
//println!("Overrided {:?}", new_ini);
|
||||
new_ini
|
||||
} else {
|
||||
ini
|
||||
|
||||
@@ -120,12 +120,11 @@ export default {
|
||||
body,
|
||||
})
|
||||
.then((res) => {
|
||||
this.is_loading = false;
|
||||
return res.json();}
|
||||
)
|
||||
.then((data) => this.template.updateJson(data))
|
||||
.catch((err) => console.error(err));
|
||||
|
||||
this.is_loading = false;
|
||||
},
|
||||
unsetMeal: function(mealKey) {
|
||||
let idx = this.template.findIndexByKey(mealKey);
|
||||
|
||||
Reference in New Issue
Block a user