From 58dc5724b9bc997e18c436f1004ebcb085b10247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Sun, 4 Feb 2018 21:32:26 +0100 Subject: [PATCH] bugfix: CreatedAt set when creating new toggle closes #94 --- frontend/CHANGELOG.md | 1 + frontend/src/component/feature/form-add-container.jsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/frontend/CHANGELOG.md b/frontend/CHANGELOG.md index 96497b4afc..e89f8cf9a7 100644 --- a/frontend/CHANGELOG.md +++ b/frontend/CHANGELOG.md @@ -9,6 +9,7 @@ The latest version of this document is always available in ## [Unreleased] - Move metrics poller to seperate class +- Bugfix: CreatedAt set when creating new toggle ## [3.0.0-alpha.6] - Bugfix: actions should always throw errors diff --git a/frontend/src/component/feature/form-add-container.jsx b/frontend/src/component/feature/form-add-container.jsx index 5ebe4ed535..d058ce0cf8 100644 --- a/frontend/src/component/feature/form-add-container.jsx +++ b/frontend/src/component/feature/form-add-container.jsx @@ -21,6 +21,8 @@ const prepare = (methods, dispatch) => { methods.onSubmit = input => e => { e.preventDefault(); + input.createdAt = new Date(); + if (Array.isArray(input.strategies)) { input.strategies.forEach(s => { delete s.id;