fixed item update

This commit is contained in:
2024-05-12 12:46:12 +02:00
parent 85cba8b1dc
commit 8b01b19365
13 changed files with 212 additions and 654 deletions

View File

@@ -1,4 +1,5 @@
const API_KEY = 'AIzaSyA_w7wmOAibpiDF5H3mXuL9AhcN-KVkFg4';
//const API_KEY = 'AIzaSyA_w7wmOAibpiDF5H3mXuL9AhcN-KVkFg4';
const API_KEY = 'AIzaSyCWPG-WbraYVEk6wVEZX8dJQAABTibvGNM';
const CSE_ID = '611cd62b5f315445c';
export async function searchAndResizeImage(query) {
@@ -11,11 +12,16 @@ export async function searchAndResizeImage(query) {
console.log('Image URL:', imageUrl);
return imageUrl;
}
else {
console.error('No image found.');
return "";
}
} catch (error) {
console.error('Error fetching image:', error);
return "";
}
console.error('No image found.');
return "";
}

View File

@@ -2,10 +2,11 @@ import axios from "axios";
export const getItem = async (_id) => {
export const getItem = async (id) => {
try {
const response = await axios.get("/item", {_id});
console.log(response.data)
console.log("GET ITEM ID : ", id)
const response = await axios.get("/item/"+id);
console.log("GET ITEM : ", response.data)
return response.data;
} catch (error) {
console.log("ERROR", error.response.data)