mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-22 22:48:09 +02:00
2 files changed
+3
-2
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 259 KiB |
@@ -35,7 +35,7 @@ export default function NewPost() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const generateTextMutation = useMutation({
|
const generateTextMutation = useMutation({
|
||||||
mutationFn: (productInfoText: string) => {
|
mutationFn: async (productInfoText: string) => {
|
||||||
const productInfo = {
|
const productInfo = {
|
||||||
name: productInfoText.match(/Produit:\s*(.+?)(?:\n|$)/i)?.[1] ||
|
name: productInfoText.match(/Produit:\s*(.+?)(?:\n|$)/i)?.[1] ||
|
||||||
productInfoText.match(/Nom:\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] || "",
|
description: productInfoText.match(/Description:\s*(.+?)(?:\n|$)/i)?.[1] || "",
|
||||||
features: productInfoText.match(/Caractéristiques:\s*(.+?)(?:\n|$)/i)?.[1]?.split(",") || [],
|
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) => {
|
onSuccess: (data: any) => {
|
||||||
const variants = data.variants || [];
|
const variants = data.variants || [];
|
||||||
|
|||||||
Reference in new issue
Block a user