Function upd

Source
pub async fn upd(
    notename: &str,
    new_note: &str,
    pool: &PgPool,
) -> Result<Note, NotebookError>
Expand description

Updates content of note and returns updated note.

§Returns

§Example

async fn upd_example(pool: &PgPool) -> Result<(), NotebookError> {
   add("wrong_note", "Thos is erong nlte", pool).await?;

   // Returns updated note
   let mut upd_row = upd("wrong_note", "This is NOT wrong note", pool).await?;

   assert_eq!("This is NOT wrong note", upd_row.note_str().await);

   Ok(())
}