You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
422 B
18 lines
422 B
use crate::cached_wattpad::get_story as get_story_from_wattpad;
|
|
use axum::extract::{Json, Query};
|
|
use serde::Deserialize;
|
|
use wattpad::Story;
|
|
|
|
#[derive(Deserialize)]
|
|
pub struct GetStoryParams {
|
|
pub id: String,
|
|
}
|
|
|
|
pub async fn get_story(Query(params): Query<GetStoryParams>) -> Json<Story> {
|
|
let story = get_story_from_wattpad(¶ms.id)
|
|
.await
|
|
.expect("idk jump off a bridge");
|
|
|
|
Json(story)
|
|
}
|