Skip to content
Snippets Groups Projects
Commit 87fd5b41 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Fix: Use Debounce on Search

parent 50e49d74
No related branches found
No related tags found
1 merge request!322merge dev into main
Pipeline #1228384 passed with warnings
......@@ -149,6 +149,7 @@ import type {
import useVuelidate from "@vuelidate/core";
import { required, url } from "@vuelidate/validators";
import CreateAPModal from "./modals/CreateAPModal.vue";
import { useDebounceFn } from "@vueuse/core";
export default defineComponent({
components: {
......@@ -190,7 +191,7 @@ export default defineComponent({
reachedEndOfAPList: () => true,
valid: (_: boolean) => true,
},
setup(props) {
setup(props, ctx) {
const resourceStore = useResourceStore();
const userStore = useUserStore();
/*
......@@ -208,7 +209,14 @@ export default defineComponent({
},
};
const v$ = useVuelidate(rules, state);
return { resourceStore, userStore, v$ };
const applicationProfileSearchChange = useDebounceFn(
(searchTerm: string) => {
ctx.emit("applicationProfileSearchChange", searchTerm);
},
500,
);
return { applicationProfileSearchChange, resourceStore, userStore, v$ };
},
data() {
......@@ -249,12 +257,6 @@ export default defineComponent({
},
methods: {
/**
* Trigger the search term change in the parent component.
*/
applicationProfileSearchChange(searchTerm: string) {
this.$emit("applicationProfileSearchChange", searchTerm);
},
/**
* Initializes the content of the selected application profile based on the current state of the resource for creation.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment