Recipe can now be scheduled
This commit is contained in:
parent
ae6da1a5ae
commit
fbef990022
18 changed files with 233 additions and 51 deletions
|
|
@ -752,7 +752,7 @@ VALUES ($1, $2)
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn add_schedule_recipe(
|
||||
pub async fn add_scheduled_recipe(
|
||||
&self,
|
||||
user_id: i64,
|
||||
recipe_id: i64,
|
||||
|
|
@ -775,7 +775,7 @@ VALUES ($1, $2, $3, $4)
|
|||
.map_err(DBError::from)
|
||||
}
|
||||
|
||||
pub async fn remove_scheduled_recipe(
|
||||
pub async fn rm_scheduled_recipe(
|
||||
&self,
|
||||
user_id: i64,
|
||||
recipe_id: i64,
|
||||
|
|
@ -964,13 +964,13 @@ VALUES
|
|||
let tomorrow = today + Days::new(1);
|
||||
|
||||
connection
|
||||
.add_schedule_recipe(user_id, recipe_id_1, today, 4)
|
||||
.add_scheduled_recipe(user_id, recipe_id_1, today, 4)
|
||||
.await?;
|
||||
connection
|
||||
.add_schedule_recipe(user_id, recipe_id_2, yesterday, 4)
|
||||
.add_scheduled_recipe(user_id, recipe_id_2, yesterday, 4)
|
||||
.await?;
|
||||
connection
|
||||
.add_schedule_recipe(user_id, recipe_id_1, tomorrow, 4)
|
||||
.add_scheduled_recipe(user_id, recipe_id_1, tomorrow, 4)
|
||||
.await?;
|
||||
|
||||
assert_eq!(
|
||||
|
|
@ -1008,13 +1008,13 @@ VALUES
|
|||
);
|
||||
|
||||
connection
|
||||
.remove_scheduled_recipe(user_id, recipe_id_1, today)
|
||||
.rm_scheduled_recipe(user_id, recipe_id_1, today)
|
||||
.await?;
|
||||
connection
|
||||
.remove_scheduled_recipe(user_id, recipe_id_2, yesterday)
|
||||
.rm_scheduled_recipe(user_id, recipe_id_2, yesterday)
|
||||
.await?;
|
||||
connection
|
||||
.remove_scheduled_recipe(user_id, recipe_id_1, tomorrow)
|
||||
.rm_scheduled_recipe(user_id, recipe_id_1, tomorrow)
|
||||
.await?;
|
||||
|
||||
assert_eq!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue