Enabled header

This commit is contained in:
Matej Glasnák committed 2023-01-17 16:16:40 +01:00
1 parent 032f045854
commit f04a2b7c55
10 files changed
+25 -24

No files matched your search

+10 -10
View File
@@ -21,7 +21,7 @@ export default {
async get_data(url: string, config?: any) {
return axios.get(url, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async get_auth_data(url: string, config?: any) {
@@ -29,7 +29,7 @@ export default {
return axios.get(url, config)
.then(response => Promise.resolve(response.data.data))
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async post(url: string, params = null, config?: any) {
@@ -51,7 +51,7 @@ export default {
return axios.post(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async post_auth_data(url: string, params = null, config?: any) {
@@ -59,7 +59,7 @@ export default {
return axios.post(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async delete(url: string, config?: any) {
@@ -79,7 +79,7 @@ export default {
async delete_data(url: string, config?: any) {
return axios.delete(url, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async delete_auth_data(url: string, config?: any) {
@@ -87,7 +87,7 @@ export default {
return axios.delete(url, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async patch(url: string, params = null, config?: any) {
@@ -107,7 +107,7 @@ export default {
async patch_data(url: string, params = null, config?: any) {
return axios.patch(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async patch_auth_data(url: string, params = null, config?: any) {
@@ -115,7 +115,7 @@ export default {
return axios.patch(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async put(url: string, params = null, config?: any) {
@@ -135,7 +135,7 @@ export default {
async put_data(url: string, params = null, config?: any) {
return axios.put(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async put_auth_data(url: string, params = null, config?: any) {
@@ -143,7 +143,7 @@ export default {
return axios.put(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
_config(config: any) {
@@ -1,7 +1,7 @@
<template>
<div>
<div v-if="!content"></div>
<div v-else-if="content?.error">{{ content.error }}</div>
<div v-else-if="content.error">{{ content.error }}</div>
<div v-else-if="(typeof content == 'array' && !array.length) || (typeof content == 'object' && !Object.values(content).length)">{{ emptyMessage }}</div>
<slot v-else></slot>
</div>
@@ -12,7 +12,7 @@ export default {
props: {
content: {
type: [Object, Array, Boolean],
default: null,
default: () => null,
},
emptyMessage: {
@@ -25,7 +25,7 @@ export default {
loader: null
}
},
created() {
this.startLoading()