This commit is contained in:
2021-09-22 18:45:39 +00:00
parent c51df5119e
commit acfcaac5cf

View File

@@ -354,9 +354,9 @@
<v-btn <v-btn
color="primary" color="primary"
text text
@click="acceptSettings()" @click="saveUserOptions()"
class="ml-4" class="ml-4"
>{{ $ay.t("OK") }}</v-btn >{{ $ay.t("Save") }}</v-btn
> >
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@@ -933,6 +933,9 @@ export default {
} catch (error) { } catch (error) {
window.$gz.errorHandler.handleFormError(error, this); window.$gz.errorHandler.handleFormError(error, this);
} }
},
async saveUserOptions() {
await saveFormUserOptions(this);
} }
//eom //eom
} }
@@ -1095,7 +1098,7 @@ async function getFormUserOptions(vm) {
window.$gz.form.setErrorBoxErrors(vm); window.$gz.form.setErrorBoxErrors(vm);
} else { } else {
if (res.data == null) { if (res.data == null) {
console.log("getFormUserOptions null setting default"); //console.log("getFormUserOptions null setting default");
//make a default //make a default
vm.formUserOptions = { vm.formUserOptions = {
firstTime: "00:00", firstTime: "00:00",
@@ -1105,7 +1108,7 @@ async function getFormUserOptions(vm) {
reminders: true reminders: true
}; };
} else { } else {
vm.formUserOptions = res.data; vm.formUserOptions = JSON.parse(res.data.options);
} }
} }
} }
@@ -1113,10 +1116,10 @@ async function getFormUserOptions(vm) {
//////////////////// ////////////////////
// //
async function saveFormUserOptions(vm) { async function saveFormUserOptions(vm) {
let res = await window.$gz.api.upsert( let res = await window.$gz.api.post("form-user-options", {
"form-user-options", formKey: FORM_KEY,
vm.formUserOptions options: JSON.stringify(vm.formUserOptions)
); });
if (res.error) { if (res.error) {
vm.formState.serverError = res.error; vm.formState.serverError = res.error;