Update reconcile to 0.8.0
This commit is contained in:
parent
2885026d2f
commit
aca1ca50a4
8 changed files with 36 additions and 30 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use axum::body::Bytes;
|
||||
use axum_typed_multipart::{FieldData, TryFromMultipart};
|
||||
use reconcile_text::NumberOrString;
|
||||
use reconcile_text::NumberOrText;
|
||||
use serde::{self, Deserialize};
|
||||
use ts_rs::TS;
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ pub struct UpdateTextDocumentVersion {
|
|||
pub relative_path: String,
|
||||
|
||||
#[ts(type = "Array<number | string>")]
|
||||
pub content: Vec<NumberOrString>,
|
||||
pub content: Vec<NumberOrText>,
|
||||
}
|
||||
|
||||
#[derive(TS, Debug, Deserialize)]
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use crate::{
|
|||
database::models::{DocumentId, StoredDocumentVersion, VaultId, VaultUpdateId},
|
||||
},
|
||||
config::user_config::User,
|
||||
errors::{SyncServerError, not_found_error, server_error},
|
||||
errors::{SyncServerError, client_error, not_found_error, server_error},
|
||||
server::requests::UpdateBinaryDocumentVersion,
|
||||
utils::{
|
||||
find_first_available_path::find_first_available_path, is_binary::is_binary,
|
||||
|
|
@ -81,7 +81,9 @@ pub async fn update_text(
|
|||
.expect("parent must be valid UTF-8 because it's a text document"),
|
||||
request.content,
|
||||
&*BuiltinTokenizer::Word,
|
||||
);
|
||||
)
|
||||
.context("Failed to apply given diff to parent document")
|
||||
.map_err(client_error)?;
|
||||
|
||||
let content = edited_text.apply().text().into_bytes();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue