1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-11-29 04:31:10 +00:00
This commit is contained in:
Felix Ableitner 2024-11-21 11:19:00 +01:00
parent 14e6382765
commit 995106dfc1
3 changed files with 9 additions and 8 deletions

View file

@ -212,7 +212,8 @@ impl ApiClient {
pub async fn resolve_instance(&self, id: Url) -> MyResult<DbInstance> {
let resolve_object = ResolveObject { id };
self.get("/api/v1/user", Some(resolve_object)).await
self.get("/api/v1/instance/resolve", Some(resolve_object))
.await
}
pub async fn get_user(&self, data: GetUserForm) -> MyResult<DbPerson> {
self.get("/api/v1/user", Some(data)).await

View file

@ -61,7 +61,7 @@ impl<T: Default + Send + Sync> DefaultResource<T> for Resource<T> {
}
pub fn shell(options: LeptosOptions) -> impl IntoView {
view! {
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
@ -107,10 +107,10 @@ pub fn App() -> impl IntoView {
// TODO: use protected route, otherwise user can view
// /article/create without login
// https://github.com/leptos-rs/leptos/blob/leptos_0.7/examples/router/src/lib.rs#L51
<Route path=path!("/article/create") view=CreateArticle />
<Route path=path!("/article/list") view=ListArticles />
<Route path=path!("/create-article") view=CreateArticle />
<Route path=path!("/articles") view=ListArticles />
<Route path=path!("/instances") view=ListInstances />
<Route path=path!("/instance/:hostname") view=InstanceDetails />
<Route path=path!("/instance/list") view=ListInstances />
<Route path=path!("/user/:name") view=UserProfile />
<Route path=path!("/login") view=Login />
<Route path=path!("/register") view=Register />

View file

@ -45,15 +45,15 @@ pub fn Nav() -> impl IntoView {
<A href="/">"Main Page"</A>
</li>
<li>
<A href="/instance/list">"Instances"</A>
<A href="/instances">"Instances"</A>
</li>
<li>
<A href="/article/list">"Articles"</A>
<A href="/articles">"Articles"</A>
</li>
<Transition>
<Show when=is_logged_in>
<li>
<A href="/article/create">"Create Article"</A>
<A href="/create-article">"Create Article"</A>
</li>
<li>
<A href="/notifications">