fix(item saving): fix Item Saving Error (400 Bad Request)
This commit is contained in:
parent
fd39e3b967
commit
de14061b9a
1 changed files with 1 additions and 11 deletions
|
@ -177,21 +177,11 @@ pub fn ItemsList(
|
|||
log!("[FRONTEND] Saving item - ID: {}, Name: '{}', Properties: {:?}",
|
||||
item.id, item.name, item.custom_properties);
|
||||
|
||||
let item_to_send = ItemRequest {
|
||||
url: current_url.to_string(),
|
||||
item: Item {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
description: item.description,
|
||||
wikidata_id: item.wikidata_id,
|
||||
custom_properties, // Use the filtered HashMap
|
||||
},
|
||||
};
|
||||
let encoded_url = encode(¤t_url);
|
||||
let api_url = format!("/api/urls/{}/items", encoded_url);
|
||||
|
||||
let response = gloo_net::http::Request::post(&api_url)
|
||||
.json(&item_to_send)
|
||||
.json(&item)
|
||||
.unwrap()
|
||||
.send()
|
||||
.await;
|
||||
|
|
Loading…
Add table
Reference in a new issue