pub async fn refresh_swag_items() {
    let db = Database::new();

    // Get all the records from Airtable.
    let results: Vec<airtable_api::Record<SwagItem>> = SwagItem::airtable().list_records(&SwagItem::airtable_table(), "Grid view", vec![]).await.unwrap();
    for item_record in results {
        let item: NewSwagItem = item_record.fields.into();

        let mut db_item = item.upsert_in_db(&db);
        db_item.airtable_record_id = item_record.id.to_string();
        db_item.update(&db).await;
    }
}
/// Sync swag items from Airtable.
Sync swag items from Airtable.
Sync swag items from Airtable .
pub async fn refresh_swag_items() {
    let db = Database::new();
    // Get all the records from Airtable.
    let results: Vec<airtable_api::Record<SwagItem>> = SwagItem::airtable().list_records(&SwagItem::airtable_table(), "Grid view", vec![]).await.unwrap();
    for item_record in results {
        let item: NewSwagItem = item_record.fields.into();
        let mut db_item = item.upsert_in_db(&db);
        db_item.airtable_record_id = item_record.id.to_string();
        db_item.update(&db).await;
    }
}
pub async fn refresh_swag_items ( ) { let db = Database :: new ( ) ; // Get all the records from Airtable. let results : Vec < airtable_api :: Record < SwagItem > > = SwagItem :: airtable ( ) . list_records ( & SwagItem :: airtable_table ( ) , " " , vec ! [ ] ) . await . unwrap ( ) ; for item_record in results { let item : NewSwagItem = item_record . fields . into ( ) ; let mut db_item = item . upsert_in_db ( & db ) ; db_item . airtable_record_id = item_record . id . to_string ( ) ; db_item . update ( & db ) . await ; } }
Sync swag items from Airtable.
Sync swag items from Airtable .