Add some HTTP tests for recipe fields and recipe tags
This commit is contained in:
parent
9c2d89e981
commit
e4ec80e118
6 changed files with 179 additions and 11 deletions
|
|
@ -115,7 +115,15 @@ pub async fn rm_tags(
|
|||
ExtractRon(ron): ExtractRon<ron_api::Tags>,
|
||||
) -> Result<impl IntoResponse> {
|
||||
check_user_rights_recipe(&connection, &context.user, ron.recipe_id).await?;
|
||||
connection.rm_recipe_tags(ron.recipe_id, &ron.tags).await?;
|
||||
connection
|
||||
.rm_recipe_tags(
|
||||
ron.recipe_id,
|
||||
&ron.tags
|
||||
.into_iter()
|
||||
.map(|tag| tag.to_lowercase())
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
.await?;
|
||||
Ok(StatusCode::OK)
|
||||
}
|
||||
|
||||
|
|
@ -157,7 +165,7 @@ pub async fn set_language(
|
|||
pub async fn set_is_public(
|
||||
State(connection): State<db::Connection>,
|
||||
Extension(context): Extension<Context>,
|
||||
ExtractRon(ron): ExtractRon<ron_api::SetIsPublic>,
|
||||
ExtractRon(ron): ExtractRon<ron_api::SetRecipeIsPublic>,
|
||||
) -> Result<StatusCode> {
|
||||
check_user_rights_recipe(&connection, &context.user, ron.recipe_id).await?;
|
||||
connection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue