mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 05:21:14 +03:30
Product
This commit is contained in:
Vendored
+6
@@ -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'})
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user