Skip to content

Commit

Permalink
fix(backend): do not schedule user for workout revision if exercise n…
Browse files Browse the repository at this point in the history
…ame changed
  • Loading branch information
IgnisDa committed Dec 8, 2024
1 parent 5e2c20d commit 8d006ec
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions crates/services/fitness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,6 @@ impl FitnessService {
{
return Err(Error::new("Exercise with the new name already exists."));
}
Exercise::update_many()
.col_expr(exercise::Column::Name, Expr::value(input.update.id.clone()))
.filter(exercise::Column::Id.eq(input.old_id.clone()))
.exec(&self.0.db)
.await?;
}
for image in old_exercise.attributes.internal_images {
if let StoredUrl::S3(key) = image {
Expand All @@ -694,7 +689,6 @@ impl FitnessService {
}
self.create_custom_exercise(&user_id, input.update.clone())
.await?;
schedule_user_for_workout_revision(&user_id, &self.0).await?;
Ok(true)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/utils/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ pub async fn calculate_user_activities_and_summary(
{
continue;
}
activity.workout_exercises.push(db_ex.id.clone());
activity.workout_exercises.push(db_ex.name.clone());
activity.workout_muscles.extend(db_ex.muscles.clone());
activity.workout_equipments.extend(db_ex.equipment.clone());
}
Expand Down

0 comments on commit 8d006ec

Please sign in to comment.