fix: search cache issue

This commit is contained in:
Jannat Patel
2024-06-28 18:51:47 +05:30
parent 279bb89ca9
commit 4ef694a2ed
2 changed files with 3 additions and 5 deletions

View File

@@ -48,7 +48,7 @@
</div>
</template>
<script setup>
import { Breadcrumbs, FormControl, createResource, debounce } from 'frappe-ui'
import { Breadcrumbs, FormControl, createResource } from 'frappe-ui'
import { ref, computed } from 'vue'
import UserAvatar from '@/components/UserAvatar.vue'
import { Search } from 'lucide-vue-next'
@@ -59,8 +59,7 @@ const participants = createResource({
url: 'lms.lms.api.get_certified_participants',
method: 'GET',
debounce: 300,
cache: ['certified_participants', searchQuery.value],
makeParams() {
makeParams(values) {
return {
search_query: searchQuery.value,
}

View File

@@ -125,12 +125,11 @@ const searchQuery = ref('')
const courses = createResource({
debounce: 300,
makeParams() {
makeParams(values) {
return {
search_query: searchQuery.value,
}
},
cache: ['courses', searchQuery.value, user?.data?.email],
url: 'lms.lms.utils.get_courses',
auto: true,
})