1
0
forked from test/crm

chore: minor changes

This commit is contained in:
Shariq Ansari 2024-01-03 16:18:03 +05:30
parent e6da9a3ef2
commit 3c27169d12
7 changed files with 6 additions and 5 deletions

View File

@ -8,7 +8,7 @@
</template> </template>
<script setup> <script setup>
import DesktopLayout from '@/components/DesktopLayout.vue' import DesktopLayout from '@/components/Layouts/DesktopLayout.vue'
import { Dialogs } from '@/utils/dialogs' import { Dialogs } from '@/utils/dialogs'
import { sessionStore as session } from '@/stores/session' import { sessionStore as session } from '@/stores/session'
import { Toasts } from 'frappe-ui' import { Toasts } from 'frappe-ui'

View File

@ -10,6 +10,6 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import AppSidebar from '@/components/AppSidebar.vue' import AppSidebar from '@/components/Layouts/AppSidebar.vue'
import AppHeader from '@/components/AppHeader.vue' import AppHeader from '@/components/Layouts/AppHeader.vue'
</script> </script>

View File

@ -268,6 +268,7 @@ function apply(reload = false, isDefault = false, reset = false) {
emit('update', obj) emit('update', obj)
if (reload) { if (reload) {
// will have think of a better way to do this
setTimeout(() => { setTimeout(() => {
is_default.value = reset ? oldValues.value.isDefault : isDefault is_default.value = reset ? oldValues.value.isDefault : isDefault
columnsUpdated.value = !reset columnsUpdated.value = !reset

View File

@ -10,6 +10,7 @@ export const contactsStore = defineStore('crm-contacts', () => {
url: 'crm.api.session.get_contacts', url: 'crm.api.session.get_contacts',
cache: 'contacts', cache: 'contacts',
initialData: [], initialData: [],
auto: true,
transform(contacts) { transform(contacts) {
for (let contact of contacts) { for (let contact of contacts) {
contactsByPhone[contact.mobile_no] = contact contactsByPhone[contact.mobile_no] = contact
@ -23,7 +24,6 @@ export const contactsStore = defineStore('crm-contacts', () => {
} }
}, },
}) })
contacts.fetch()
function getContact(mobile_no) { function getContact(mobile_no) {
return contactsByPhone[mobile_no] return contactsByPhone[mobile_no]

View File

@ -9,6 +9,7 @@ export const organizationsStore = defineStore('crm-organizations', () => {
url: 'crm.api.session.get_organizations', url: 'crm.api.session.get_organizations',
cache: 'organizations', cache: 'organizations',
initialData: [], initialData: [],
auto: true,
transform(organizations) { transform(organizations) {
for (let organization of organizations) { for (let organization of organizations) {
organizationsByName[organization.name] = organization organizationsByName[organization.name] = organization
@ -21,7 +22,6 @@ export const organizationsStore = defineStore('crm-organizations', () => {
} }
}, },
}) })
organizations.fetch()
function getOrganization(name) { function getOrganization(name) {
return organizationsByName[name] return organizationsByName[name]