fixed item update
This commit is contained in:
@@ -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 "";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user