mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
implemented search
This commit is contained in:
@ -6,6 +6,7 @@ import {
|
||||
haexPasswordsItemKeyValues,
|
||||
type InsertHaexPasswordsItemDetails,
|
||||
type InserthaexPasswordsItemKeyValues,
|
||||
type SelectHaexPasswordsGroupItems,
|
||||
type SelectHaexPasswordsGroups,
|
||||
type SelectHaexPasswordsItemDetails,
|
||||
type SelectHaexPasswordsItemKeyValues,
|
||||
@ -23,6 +24,25 @@ export const usePasswordItemStore = defineStore('passwordItemStore', () => {
|
||||
|
||||
const currentItem = computedAsync(() => readAsync(currentItemId.value))
|
||||
|
||||
const items = ref<
|
||||
{
|
||||
haex_passwords_item_details: SelectHaexPasswordsItemDetails
|
||||
haex_passwords_group_items: SelectHaexPasswordsGroupItems
|
||||
}[]
|
||||
>([])
|
||||
|
||||
const syncItemsAsync = async () => {
|
||||
const { currentVault } = useVaultStore()
|
||||
|
||||
items.value = await currentVault.drizzle
|
||||
.select()
|
||||
.from(haexPasswordsItemDetails)
|
||||
.innerJoin(
|
||||
haexPasswordsGroupItems,
|
||||
eq(haexPasswordsItemDetails.id, haexPasswordsGroupItems.itemId),
|
||||
)
|
||||
}
|
||||
|
||||
return {
|
||||
currentItemId,
|
||||
currentItem,
|
||||
@ -31,9 +51,11 @@ export const usePasswordItemStore = defineStore('passwordItemStore', () => {
|
||||
addKeyValuesAsync,
|
||||
deleteAsync,
|
||||
deleteKeyValueAsync,
|
||||
items,
|
||||
readByGroupIdAsync,
|
||||
readAsync,
|
||||
readKeyValuesAsync,
|
||||
syncItemsAsync,
|
||||
updateAsync,
|
||||
}
|
||||
})
|
||||
|
||||
7
src/stores/vault/search.ts
Normal file
7
src/stores/vault/search.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export const useSearchStore = defineStore('searchStore', () => {
|
||||
const search = ref()
|
||||
|
||||
return {
|
||||
search,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user