This commit is contained in:
saeid
2019-04-29 19:39:39 +04:30
parent a8a6780c17
commit 3cced107bb
26 changed files with 36 additions and 75999 deletions
+6
View File
@@ -28,6 +28,12 @@ const urls = {
editTestResult : function(id) {
return `/TestResults/${id}/edit`;
},
updateTestResult : function(id) {
return `/TestResults/${id}`;
},
removeTestResult : function(id) {
return `/TestResults/${id}`;
},
updateMedicalCenter : function(id) {
return `/MedicalCenters/${id}`;
},
@@ -195,7 +195,12 @@ export default {
}
},
async submitForm() {
const result = await ApiService.post(urls.storeTestResult, this.formData);
if (this.$route.params.testResult) {
const result = await ApiService.put(urls.updateTestResult(this.$route.params.testResult), this.formData);
} else {
const result = await ApiService.post(urls.storeTestResult, this.formData);
}
if (result && result.status == 200) {
this.$router.push({name: 'Dashboard'})
}
+1 -1
View File
@@ -156,7 +156,7 @@ export default {
}
},
async remove(testResultId) {
const result = await ApiService.get(urls.removeTestResult(testResultId));
const result = await ApiService.delete(urls.removeTestResult(testResultId));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) {