mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 00:30:27 +00:00
add new query parameter
This commit is contained in:
parent
f8cf62381e
commit
bbd09a6f0a
2 changed files with 8 additions and 1 deletions
|
@ -10,13 +10,19 @@ export function useItemSearch(client: UserClient, opts?: SearchOptions) {
|
|||
const locations = ref<LocationSummary[]>([]);
|
||||
const labels = ref<LabelSummary[]>([]);
|
||||
const results = ref<ItemSummary[]>([]);
|
||||
const includeArchived = ref(false);
|
||||
|
||||
watchDebounced(query, search, { debounce: 250, maxWait: 1000 });
|
||||
async function search() {
|
||||
const locIds = locations.value.map(l => l.id);
|
||||
const labelIds = labels.value.map(l => l.id);
|
||||
|
||||
const { data, error } = await client.items.getAll({ q: query.value, locations: locIds, labels: labelIds });
|
||||
const { data, error } = await client.items.getAll({
|
||||
q: query.value,
|
||||
locations: locIds,
|
||||
labels: labelIds,
|
||||
includeArchived: includeArchived.value,
|
||||
});
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
import { AttachmentTypes, PaginationResult } from "../types/non-generated";
|
||||
|
||||
export type ItemsQuery = {
|
||||
includeArchived?: boolean;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
locations?: string[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue