···1212pub use sea_orm::EntityTrait;
1313pub use sea_orm::IntoActiveModel;
1414pub use sea_orm::QueryFilter;
1515+pub use sea_orm::QueryOrder;
15161617/// Exporting this as a generic NanoId.
1718pub use migration::types::NanoId;
···133133 let zid = zettel.id.clone();
134134 let idx = self.graph.add_node(zettel);
135135136136- gid = Some(
137137- self.zid_to_gid
138138- .insert(zid.clone(), idx)
139139- .expect("this cannot have existed already"),
140140- );
136136+ self.zid_to_gid.insert(zid.clone(), idx);
137137+138138+ gid = Some(idx);
141139142140 self.get_node_by_zettel_id_mut(&zid)
143141 .expect("we just inserted it")
144142 .payload_mut()
145143 };
146144145145+ // and then we sync with the file
146146+ zettel.sync_with_file(&ws).await?;
147147+147148 // to get past borrowchecker rules
148148- let mut zettel = zettel.clone();
149149+ let zettel = zettel.clone();
149150150151 // gid must be set
151152 let gid = gid.unwrap();
152152-153153- // and then we sync with the file
154154- zettel.sync_with_file(&ws).await?;
155153156154 // and now we manage the links going out of the file
157155