Squashed commit of the following:

commit 4aa3e04df0
Author: smilerz <smilerz@gmail.com>
Date:   Wed Sep 6 09:01:07 2023 -0500

    clears search on food in shopping form
This commit is contained in:
smilerz 2023-09-12 09:47:07 -05:00
parent 9e831a22df
commit 847fceaf10
No known key found for this signature in database
GPG Key ID: 39444C7606D47126

View File

@ -4,7 +4,7 @@
v-model="selected_objects" v-model="selected_objects"
:options="objects" :options="objects"
:close-on-select="true" :close-on-select="true"
:clear-on-select="multiple" :clear-on-select="true"
:hide-selected="multiple" :hide-selected="multiple"
:preserve-search="true" :preserve-search="true"
:internal-search="false" :internal-search="false"
@ -149,7 +149,6 @@ export default {
methods: { methods: {
// this.genericAPI inherited from ApiMixin // this.genericAPI inherited from ApiMixin
search: function (query) { search: function (query) {
let options = { let options = {
page: 1, page: 1,
pageSize: this.limit, pageSize: this.limit,
@ -187,8 +186,9 @@ export default {
}, },
addNew(e) { addNew(e) {
//TODO add ability to choose field name other than "name" //TODO add ability to choose field name other than "name"
console.log('CREATEING NEW with -> ', e) console.log("CREATEING NEW with -> ", e)
this.genericAPI(this.model, this.Actions.CREATE, {name: e}).then(result => { this.genericAPI(this.model, this.Actions.CREATE, { name: e })
.then((result) => {
let createdObj = result.data?.results ?? result.data let createdObj = result.data?.results ?? result.data
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_CREATE) StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_CREATE)
if (this.multiple) { if (this.multiple) {
@ -198,7 +198,8 @@ export default {
} }
this.objects.push(createdObj) this.objects.push(createdObj)
this.selectionChanged() this.selectionChanged()
}).catch((r, err) => { })
.catch((r, err) => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_CREATE) StandardToasts.makeStandardToast(this, StandardToasts.FAIL_CREATE)
}) })
}, },