Hotfix: fixed filter when searching by id #1063

Merged
jon merged 6 commits from Hotfix-TicketFilter into master 2024-12-11 13:35:56 +00:00
2 changed files with 16 additions and 15 deletions

View File

@ -51,10 +51,6 @@ const props = defineProps({
type: Object, type: Object,
default: null, default: null,
}, },
staticParams: {
type: Array,
default: () => [],
},
exprBuilder: { exprBuilder: {
type: Function, type: Function,
default: null, default: null,
@ -102,11 +98,15 @@ onMounted(() => {
async function search() { async function search() {
const staticParams = Object.entries(store.userParams); const staticParams = Object.entries(store.userParams);
arrayData.reset(['skip', 'page']); arrayData.reset(['skip', 'page']);
let filter = {
const filter = { params: {
search: searchText.value,
},
};
if (!searchText.value) {
Outdated
Review

if (!searchText.value)

if (!searchText.value)
filter = {
params: { params: {
...Object.fromEntries(staticParams), ...Object.fromEntries(staticParams),
search: searchText.value,
}, },
...{ filter: props.filter }, ...{ filter: props.filter },
}; };
@ -117,6 +117,7 @@ async function search() {
}; };
delete filter.params.search; delete filter.params.search;
} }
}
await arrayData.applyFilter(filter); await arrayData.applyFilter(filter);
} }
</script> </script>

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { computed, ref, onMounted } from 'vue'; import { computed, ref, onBeforeMount } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -46,7 +46,7 @@ const userParams = {
from: null, from: null,
to: null, to: null,
}; };
onMounted(() => { onBeforeMount(() => {
initializeFromQuery(); initializeFromQuery();
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
if (!route.query.createForm) return; if (!route.query.createForm) return;