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