fix: moved FCRM Settings call out of composable to avoid calling everytime
This commit is contained in:
parent
83ffb39bee
commit
964660940e
@ -4,17 +4,17 @@ import { reactive, ref } from 'vue'
|
|||||||
const settings = ref({})
|
const settings = ref({})
|
||||||
const brand = reactive({})
|
const brand = reactive({})
|
||||||
|
|
||||||
export function getSettings() {
|
const _settings = createDocumentResource({
|
||||||
const _settings = createDocumentResource({
|
doctype: 'FCRM Settings',
|
||||||
doctype: 'FCRM Settings',
|
name: 'FCRM Settings',
|
||||||
name: 'FCRM Settings',
|
onSuccess: (data) => {
|
||||||
onSuccess: (data) => {
|
settings.value = data
|
||||||
settings.value = data
|
getSettings().setupBrand()
|
||||||
setupBrand()
|
return data
|
||||||
return data
|
},
|
||||||
},
|
})
|
||||||
})
|
|
||||||
|
|
||||||
|
export function getSettings() {
|
||||||
function setupBrand() {
|
function setupBrand() {
|
||||||
brand.name = settings.value?.brand_name
|
brand.name = settings.value?.brand_name
|
||||||
brand.logo = settings.value?.brand_logo
|
brand.logo = settings.value?.brand_logo
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user