From 7b61ccf99b7a5e26c0c1513740904f4ca087e552 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Thu, 23 Mar 2023 21:18:01 +0000 Subject: [PATCH] editing med feeds works, working on adding --- src/views/medfeeds/MedFeedsEdit.vue | 6 +++--- src/views/medfeeds/MedFeedsList.vue | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/medfeeds/MedFeedsEdit.vue b/src/views/medfeeds/MedFeedsEdit.vue index e7e26fb..18282f4 100644 --- a/src/views/medfeeds/MedFeedsEdit.vue +++ b/src/views/medfeeds/MedFeedsEdit.vue @@ -133,13 +133,13 @@ export default { this.errors = [] this.saving = true let url = this.$api_url + "/customers/medicated-feeds/" + this.mf.id + "/save" - if (this.contract.isNew) { + if (this.mf.isNew) { url = this.$api_url + "/customers/medicated-feeds/add" } console.log("Saving Med Feed...") - axios.put(url,{ + axios.post(url,{ medfeed: medfeed - }) + }) .then(resp => { let stat = resp.data if (stat.status == true ) { diff --git a/src/views/medfeeds/MedFeedsList.vue b/src/views/medfeeds/MedFeedsList.vue index a47cace..e589c86 100644 --- a/src/views/medfeeds/MedFeedsList.vue +++ b/src/views/medfeeds/MedFeedsList.vue @@ -117,7 +117,8 @@ export default { } let clist = this.list.filter(q => q.customer.name.toLowerCase().includes(query) || - q.customer.acc_no.includes(query) + q.customer.acc_no.includes(query) || + q.id == query ) return clist }