From 1ef1c5a61ca1e10dc4672be29193c87ffb963c82 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sat, 22 Aug 2020 14:13:13 +0530 Subject: [PATCH] Fix incorrect default values and server response in list creation UI --- cmd/lists.go | 2 +- frontend/src/views/ListForm.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/lists.go b/cmd/lists.go index 076988f9..91693806 100644 --- a/cmd/lists.go +++ b/cmd/lists.go @@ -107,7 +107,7 @@ func handleCreateList(c echo.Context) error { // Hand over to the GET handler to return the last insertion. c.SetParamNames("id") c.SetParamValues(fmt.Sprintf("%d", newID)) - return c.JSON(http.StatusOK, handleGetLists(c)) + return handleGetLists(c) } // handleUpdateList handles list modification. diff --git a/frontend/src/views/ListForm.vue b/frontend/src/views/ListForm.vue index 2aba0ce3..6decca55 100644 --- a/frontend/src/views/ListForm.vue +++ b/frontend/src/views/ListForm.vue @@ -67,9 +67,9 @@ export default Vue.extend({ // Binds form input values. form: { name: '', - type: '', - optin: '', - tags: '', + type: 'private', + optin: 'single', + tags: [], }, }; }, @@ -114,7 +114,7 @@ export default Vue.extend({ }, mounted() { - this.form = { ...this.$props.data }; + this.form = { ...this.form, ...this.$props.data }; this.$nextTick(() => { this.$refs.focus.focus();