pub fn create_list(list: ListDTO, conn: &PgConnection) -> Option<List> {
        let list = NewList {
            name: list.name,
            description: list.description,
            date_created: Utc::now().naive_local().date(),
        };

        let result = diesel::insert_into(lists)
            .values(&list)
            .get_result(conn);

        match result {
            Ok(row) => Some(row),
            Err(_) => None,
        }
    }
/// Attempts to create a new list with the specified information and the current local
/// date for the "date_created" column.
/// If the row is created, returns its contents, otherwise returns none.
Attempts to create a new list with the specified information and the current local
date for the "date_created" column.
If the row is created, returns its contents, otherwise returns none.
Attempts to create a new list with the specified information and the current local date for the " date_created " column . If the row is created returns its contents otherwise returns none .
pub fn create_list(list: ListDTO, conn: &PgConnection) -> Option<List> {
        let list = NewList {
            name: list.name,
            description: list.description,
            date_created: Utc::now().naive_local().date(),
        };
        let result = diesel::insert_into(lists)
            .values(&list)
            .get_result(conn);
        match result {
            Ok(row) => Some(row),
            Err(_) => None,
        }
    }
pub fn create_list ( list : ListDTO , conn : & PgConnection ) -> Option < List > { let list = NewList { name : list . name , description : list . description , date_created : Utc :: now ( ) . naive_local ( ) . date ( ) , } ; let result = diesel :: insert_into ( lists ) . values ( & list ) . get_result ( conn ) ; match result { Ok ( row ) => Some ( row ) , Err ( _ ) => None , } }
Attempts to create a new list with the specified information and the current local
date for the "date_created" column.
Attempts to create a new list with the specified information and the current local date for the " date_created " column .
list
ListDTO
conn
&PgConnection
list
ListDTO
conn
&PgConnection