fix(admin): resolve compilation errors in posts and write pages

This commit is contained in:
xfy 2026-06-03 10:57:22 +08:00
parent 6c039e16e8
commit c6ced73bac
2 changed files with 3 additions and 2 deletions

View File

@ -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());
}

View File

@ -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]