Skip to content

Commit

Permalink
cleanup: always return the correct OpenAPI spec specified reponse for…
Browse files Browse the repository at this point in the history
… create_groups_query
  • Loading branch information
skeptrunedev committed Aug 6, 2024
1 parent 5ffbc3a commit cf38d26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/src/operators/group_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub async fn create_groups_query(

let mut conn = pool.get().await.unwrap();

let inserted_groups = if upsert_by_tracking_id {
let mut inserted_groups = if upsert_by_tracking_id {
diesel::insert_into(chunk_group_columns::chunk_group)
.values(&new_groups)
.on_conflict((
Expand Down Expand Up @@ -142,6 +142,9 @@ pub async fn create_groups_query(
ServiceError::BadRequest("Error inserting groups".to_string())
})?
};
if inserted_groups.is_empty() {
inserted_groups = new_groups;
}

Ok(inserted_groups)
}
Expand Down

0 comments on commit cf38d26

Please sign in to comment.