Skip to content

Commit

Permalink
Fix duplicate bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AltF02 committed Dec 27, 2021
1 parent 35e1dff commit e08611b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/services/database/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ impl From<Launch> for DBLaunch {

impl DB {
pub async fn get_launch(&self, id: &LaunchID, dispatched: bool) -> Option<DBLaunch> {
sqlx::query_as(
"SELECT dispatched, net FROM astra.launches WHERE launch_id = $1 AND dispatched = $2",
)
.bind(id)
.bind(dispatched)
.fetch_optional(&self.pool)
.await
.unwrap_or(None)
sqlx::query_as("SELECT * FROM astra.launches WHERE launch_id = $1 AND dispatched = $2")
.bind(id)
.bind(dispatched)
.fetch_optional(&self.pool)
.await
.unwrap()
}

pub async fn get_launches(&self) -> Vec<DBLaunch> {
Expand Down

0 comments on commit e08611b

Please sign in to comment.