cleanup res.error overly complex
This commit is contained in:
@@ -387,7 +387,7 @@ export default {
|
||||
window.$gz.api
|
||||
.get(url)
|
||||
.then(res => {
|
||||
if (res.error != undefined) {
|
||||
if (res.error) {
|
||||
//Not found?
|
||||
if (res.error.code == "2010") {
|
||||
//notify not found error then navigate backwards
|
||||
@@ -438,7 +438,7 @@ export default {
|
||||
.upsert(url, vm.obj)
|
||||
.then(res => {
|
||||
vm.formState.loading = false;
|
||||
if (res.error != undefined) {
|
||||
if (res.error) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
@@ -488,7 +488,7 @@ export default {
|
||||
window.$gz.api
|
||||
.remove(url)
|
||||
.then(res => {
|
||||
if (res.error != undefined) {
|
||||
if (res.error) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
@@ -525,7 +525,7 @@ export default {
|
||||
.then(res => {
|
||||
// debugger;
|
||||
vm.formState.loading = false;
|
||||
if (res.error != undefined) {
|
||||
if (res.error) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user