INSHALLAH SUI
This commit is contained in:
@@ -1,10 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
models::{AutoIssuedTicket, IssuedTicket, NewTicket, Ticket},
|
models::{AutoIssuedTicket, IssuedTicket, NewTicket, Ticket},
|
||||||
schema::{
|
schema::{issued_tickets, tickets},
|
||||||
drivers,
|
|
||||||
issued_tickets::{self, driver},
|
|
||||||
tickets,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use common::CommonTicket;
|
use common::CommonTicket;
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
@@ -30,7 +26,8 @@ pub fn get_tickets(connection: &mut PgConnection, driver_id: i32) -> Vec<CommonT
|
|||||||
tickets::category,
|
tickets::category,
|
||||||
tickets::description,
|
tickets::description,
|
||||||
tickets::issue_date, //only selecting the ticket tho :D
|
tickets::issue_date, //only selecting the ticket tho :D
|
||||||
));
|
))
|
||||||
|
.filter(tickets::id.eq(driver_id));
|
||||||
let tickets_by_driver = join.load::<Ticket>(connection).expect("oh no!");
|
let tickets_by_driver = join.load::<Ticket>(connection).expect("oh no!");
|
||||||
let common_ticket_output = tickets_by_driver
|
let common_ticket_output = tickets_by_driver
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user