all products page
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const allProduct = async () => {
|
||||
try{
|
||||
const res = await axios.get('https://api.serenmebel.uz/api/products/');
|
||||
console.log("all products res: ",res);
|
||||
|
||||
return res
|
||||
}catch(err){
|
||||
console.log("all product error: ",err);
|
||||
return []
|
||||
}
|
||||
};
|
||||
export async function GET() {
|
||||
try {
|
||||
const res = await axios.get("https://api.serenmebel.uz/api/products/");
|
||||
console.log("all products res: ", res?.data);
|
||||
|
||||
return Response.json(res.data);
|
||||
} catch (error: any) {
|
||||
console.log("all products error: ", error);
|
||||
|
||||
return Response.json({ error: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user