diff --git a/src/components/production/ProductionPage.tsx b/src/components/production/ProductionPage.tsx index 58a2e474..7b453eec 100644 --- a/src/components/production/ProductionPage.tsx +++ b/src/components/production/ProductionPage.tsx @@ -64,15 +64,9 @@ const ProductionPage: React.FC = (props) => { }, []); // EVERY TIME THE PRODUCTION IS UPDATE -> UPLOAD IT TO DB - useEffect(() => { - if (production) { - putProduction(production._id, production); - } - }, [production]); - useEffect(() => { if (production?._id) { - setProduction({ + putProduction(production._id, { ...production, name: productionName, sources, @@ -80,7 +74,7 @@ const ProductionPage: React.FC = (props) => { outputs, multiviews, control_connection: controlConnection - } as Production); + }); } }, [ productionName,