Merge pull request #19 from R0m1k3/dev

Dev
This commit is contained in:
LogiFlow authored and GitHub committed 2025-10-02 15:18:28 +02:00
commit befe30296d
2 files changed
+3 -2

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

+3 -2
View File
@@ -35,7 +35,7 @@ export default function NewPost() {
});
const generateTextMutation = useMutation({
mutationFn: (productInfoText: string) => {
mutationFn: async (productInfoText: string) => {
const productInfo = {
name: productInfoText.match(/Produit:\s*(.+?)(?:\n|$)/i)?.[1] ||
productInfoText.match(/Nom:\s*(.+?)(?:\n|$)/i)?.[1] ||
@@ -44,7 +44,8 @@ export default function NewPost() {
description: productInfoText.match(/Description:\s*(.+?)(?:\n|$)/i)?.[1] || "",
features: productInfoText.match(/Caractéristiques:\s*(.+?)(?:\n|$)/i)?.[1]?.split(",") || [],
};
return apiRequest('POST', '/api/ai/generate', productInfo);
const response = await apiRequest('POST', '/api/ai/generate', productInfo);
return response.json();
},
onSuccess: (data: any) => {
const variants = data.variants || [];