diff --git a/Cargo.lock b/Cargo.lock
index b5de244..7bb48e3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -505,7 +505,9 @@ name = "db-frontend"
version = "0.1.0"
dependencies = [
"common",
- "diesel",
+ "gloo-net",
+ "serde",
+ "serde_json",
"yew",
]
diff --git a/common/src/lib.rs b/common/src/lib.rs
index 7899bf3..c6b8fb9 100644
--- a/common/src/lib.rs
+++ b/common/src/lib.rs
@@ -23,4 +23,3 @@ pub struct CommonDriver {
pub name: String,
pub address: String,
}
-
diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml
index 18ac030..d62c410 100644
--- a/frontend/Cargo.toml
+++ b/frontend/Cargo.toml
@@ -8,4 +8,19 @@ edition = "2021"
[dependencies]
yew = { version = "0.20.0", features = ["csr"] }
common = { path = "../common"}
-diesel = { version = "2.0.0",features = ["postgres","r2d2"] }
+gloo-net = {version = "0.2"}
+serde = { version = "1.0.126", features = ["derive"] }
+serde_json = "1.0.64"
+wasm-bindgen = "0.2"
+wasm-bindgen-futures = "0.4"
+
+[dependencies.web-sys]
+version = "0.3"
+features = [
+ "Headers",
+ "Request",
+ "RequestInit",
+ "RequestMode",
+ "Response",
+ "Window",
+]
diff --git a/frontend/src/fetching.rs b/frontend/src/fetching.rs
new file mode 100644
index 0000000..48f5270
--- /dev/null
+++ b/frontend/src/fetching.rs
@@ -0,0 +1,42 @@
+use common::{CommonAdmin, CommonDriver};
+use yew::{html, Html};
+//Trait to handle Future yew HTMLS
+pub trait UseAble {
+ //Return HTML if didn't fail return error if not
+ fn use_it(self) -> Result;
+}
+impl UseAble for CommonDriver {
+ fn use_it(self) -> Result {
+ let name = self.name;
+ let email = self.address;
+ let id = self.id;
+ let html = html! {
+
+
{ "Driver:" }
+
{ format!("Name: {}", name) }
+
{ format!("Email: {}", email) }
+
{ format!("ID: {}", id) }
+
+ };
+ Ok(html)
+ }
+}
+impl UseAble for CommonAdmin {
+ fn use_it(self) -> Result {
+ let name = self.name;
+ let email = self.address;
+ let id = self.id;
+ let html = html! {
+