From 9350c74091d267e225d7503ab3a701f2448a6000 Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Wed, 11 Dec 2024 03:47:03 +0000 Subject: [PATCH] Added mock api functions, need to implement later --- src/pages/artist.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/pages/artist.rs b/src/pages/artist.rs index 349b634..a794d4f 100644 --- a/src/pages/artist.rs +++ b/src/pages/artist.rs @@ -151,3 +151,28 @@ fn RelatedArtists(#[prop(into)] artist_id: MaybeSignal) -> impl IntoView { } } + +pub async fn get_artist_by_id(artist_id: i32) -> Result, NoCustomError> { + // todo + Ok(Some(Artist { + id: Some(artist_id), + name: "Example Artist".to_string(), + bio: Some("A great artist!".to_string()), + })) +} + +pub async fn get_related_artists(artist_id: i32) -> Result, NoCustomError> { + // todo + Ok(vec![ + Artist { + id: Some(artist_id + 1), + name: "Related Artist 1".to_string(), + bio: None, + }, + Artist { + id: Some(artist_id + 2), + name: "Related Artist 2".to_string(), + bio: None, + }, + ]) +} \ No newline at end of file