diff options
author | xengineering <me@xengineering.eu> | 2024-05-17 17:06:55 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-05-17 17:14:35 +0200 |
commit | 0416f520cff9716792ac0f3ade5f71187d07ac2e (patch) | |
tree | d4b4710a56ee38ee1bcf0c12f99c239909eebc15 | |
parent | c61e45a5a260d9804ebc4f54814edf1e1b471ac3 (diff) | |
download | ceres-0416f520cff9716792ac0f3ade5f71187d07ac2e.tar ceres-0416f520cff9716792ac0f3ade5f71187d07ac2e.tar.zst ceres-0416f520cff9716792ac0f3ade5f71187d07ac2e.zip |
view: Fix time stamp bug
The recipe edit page HTML template did not contain the two time stamps
"Created" and "LastChanged" as hidden form values.
Thus the information was not passed from the backend to the frontend. On
a save the recipe without time stamp information was injected into the
backend.
This effectively deleted any time stamp information. This commit fixes
that bug by including all fields of the model.Recipe struct inside the
form of the recipe-edit.html template.
-rw-r--r-- | view/html/recipe-edit.html | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/view/html/recipe-edit.html b/view/html/recipe-edit.html index f8a6bd9..cd3ba86 100644 --- a/view/html/recipe-edit.html +++ b/view/html/recipe-edit.html @@ -10,6 +10,8 @@ <main> <form action="/recipe{{if ne .Id ""}}/{{.Id}}{{end}}" onsubmit="updateRecipe(event)"> <input type="hidden" name="id" value="{{.Id}}"> + <input type="hidden" name="created" value="{{.Created}}"> + <input type="hidden" name="last_changed" value="{{.LastChanged}}"> <p><input type="text" name="title" value="{{.Title}}" placeholder="Title" required></p> <p><input type="number" name="portions" value="{{.Portions}}" placeholder="Portions"></p> |