fix(upload): disable default body limit and fix error object serialization
This commit is contained in:
parent
ad6c69b0e8
commit
26eb62c2ae
@ -68,7 +68,8 @@ class TiptapEditorInstance {
|
|||||||
editor.chain().focus().setImage({ src: url }).run()
|
editor.chain().focus().setImage({ src: url }).run()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('[TiptapEditor] Upload failed:', err)
|
const msg = err instanceof Error ? err.message : String(err)
|
||||||
|
console.error('[TiptapEditor] Upload failed:', msg)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -84,7 +85,8 @@ class TiptapEditorInstance {
|
|||||||
}).run()
|
}).run()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('[TiptapEditor] Upload failed:', err)
|
const msg = err instanceof Error ? err.message : String(err)
|
||||||
|
console.error('[TiptapEditor] Upload failed:', msg)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,11 @@ fn main() {
|
|||||||
.invalidate_after(std::time::Duration::from_secs(300)),
|
.invalidate_after(std::time::Duration::from_secs(300)),
|
||||||
);
|
);
|
||||||
let router = axum::Router::new()
|
let router = axum::Router::new()
|
||||||
.route("/api/upload", axum::routing::post(crate::api::upload::upload_image))
|
.route(
|
||||||
|
"/api/upload",
|
||||||
|
axum::routing::post(crate::api::upload::upload_image)
|
||||||
|
.layer(axum::extract::DefaultBodyLimit::disable()),
|
||||||
|
)
|
||||||
.nest_service("/uploads", tower_http::services::ServeDir::new("uploads"))
|
.nest_service("/uploads", tower_http::services::ServeDir::new("uploads"))
|
||||||
.serve_dioxus_application(config, router::AppRouter)
|
.serve_dioxus_application(config, router::AppRouter)
|
||||||
.layer(
|
.layer(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user