Skip to content

Commit e5e2b30

Browse files
luizhf42otavio
authored andcommitted
fix(ui): accept empty filter ("") in devices and containers list filtering
1 parent 91afb14 commit e5e2b30

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ui/src/components/Tags/TagSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const loadInitialTags = async (): Promise<void> => {
132132
await loadTags();
133133
};
134134
135-
const fetchDevices = async (filter?: string): Promise<void> => {
135+
const fetchDevices = async (filter = ""): Promise<void> => {
136136
const fetch = {
137137
device: () => devicesStore.fetchDeviceList({ filter }),
138138
container: () => containersStore.fetchContainerList({ filter }),

ui/src/store/modules/containers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const useContainersStore = defineStore("containers", () => {
1111
const containerListFilter = ref<string>();
1212

1313
const fetchContainerList = async (data?: FetchContainerParams) => {
14-
const filter = data?.filter || containerListFilter.value;
14+
const filter = data?.filter === undefined ? containerListFilter.value : data.filter;
1515
containerListFilter.value = filter;
1616
try {
1717
const res = await containerApi.fetchContainers(

ui/src/store/modules/devices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const useDevicesStore = defineStore("devices", () => {
1919
const selectedDevices = ref<Array<IDevice>>([]);
2020

2121
const fetchDeviceList = async (data?: FetchDevicesParams) => {
22-
const filter = data?.filter || deviceListFilter.value;
22+
const filter = data?.filter === undefined ? deviceListFilter.value : data.filter;
2323
deviceListFilter.value = filter;
2424
try {
2525
const res = await devicesApi.fetchDevices(

0 commit comments

Comments
 (0)