fix(admin): resolve compilation errors in posts and write pages
This commit is contained in:
parent
6c039e16e8
commit
c6ced73bac
@ -57,11 +57,11 @@ pub fn Posts() -> Element {
|
||||
Ok(CreatePostResponse { success: true, .. }) => {
|
||||
posts_res.restart();
|
||||
}
|
||||
Ok(CreatePostResponse { success: false, message: _, .. }) => {
|
||||
Ok(CreatePostResponse { success: false, message, .. }) => {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
web_sys::window().map(|w| w.alert_with_message(&message).ok());
|
||||
}
|
||||
Err(_e) => {
|
||||
Err(e) => {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
web_sys::window().map(|w| w.alert_with_message(&format!("删除失败: {}", e)).ok());
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ use dioxus::prelude::*;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use wasm_bindgen::JsCast;
|
||||
|
||||
use crate::api::posts::{create_post, CreatePostResponse};
|
||||
use crate::components::write_skeleton::WriteSkeleton;
|
||||
|
||||
#[component]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user