mv ArticleData to article

This commit is contained in:
Adam 2024-01-18 23:14:50 -05:00
parent 9f6256c5cb
commit 7fa3efb478
2 changed files with 10 additions and 10 deletions

View file

@ -1,5 +1,13 @@
use crate::components::slingshot::*;
use leptos::*; use leptos::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ArticleData {
pub content_type: String,
pub title: String,
pub date: String, // make datetime?
pub content: String,
}
#[component] #[component]
pub fn Article(data: ArticleData) -> impl IntoView { pub fn Article(data: ArticleData) -> impl IntoView {

View file

@ -1,13 +1,5 @@
use leptos::*; use leptos::*;
use serde::{Deserialize, Serialize}; use crate::components::article::ArticleData;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ArticleData {
pub content_type: String,
pub title: String,
pub date: String, // make datetime?
pub content: String,
}
#[server] #[server]
pub async fn slingshot(path: String) -> Result<Vec<ArticleData>, ServerFnError> { pub async fn slingshot(path: String) -> Result<Vec<ArticleData>, ServerFnError> {