Add working API calls, fix warnings
All checks were successful
Build Crate / build (push) Successful in 7m16s

This commit is contained in:
2023-09-21 20:03:16 -04:00
parent 30b637dfef
commit 0a68829d6c
12 changed files with 147 additions and 69 deletions

View File

@@ -2,10 +2,12 @@ pub mod index;
pub mod add_game_form;
pub mod one_v_one_board;
pub mod overall_board;
pub mod global_state;
#[cfg(client)]
use perseus::utils::get_path_prefix_client;
#[allow(dead_code)]
pub fn get_api_path(path: &str) -> String {
#[cfg(engine)]
{
@@ -13,9 +15,8 @@ pub fn get_api_path(path: &str) -> String {
}
#[cfg(client)]
{
let path = web_sys::window().unwrap().location().pathname().unwrap();
// let base_path = get_path_prefix_client();
// format!("{}{}", base_path, path)
path.to_string()
let origin = web_sys::window().unwrap().origin();
let base_path = get_path_prefix_client();
format!("{}{}{}", origin, base_path, path)
}
}
}