refactor: documents interfaces
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
import { computed, ref, readonly } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import type {
|
||||
SourceSelector,
|
||||
CollectionIdentifier,
|
||||
ServiceIdentifier,
|
||||
ListFilter,
|
||||
ListSort,
|
||||
ListRange,
|
||||
@@ -112,13 +113,9 @@ export const useNodesStore = defineStore('documentsNodesStore', () => {
|
||||
): Promise<CollectionObject[]> {
|
||||
error.value = null
|
||||
try {
|
||||
const sources: SourceSelector = {
|
||||
[providerId]: {
|
||||
[String(serviceId)]: collectionId === null
|
||||
? true
|
||||
: { [String(collectionId)]: true },
|
||||
},
|
||||
}
|
||||
const sources: (ServiceIdentifier | CollectionIdentifier)[] = collectionId === null
|
||||
? [`${providerId}:${serviceId}`]
|
||||
: [`${providerId}:${serviceId}:${collectionId}`]
|
||||
|
||||
await collectionsStore.list(sources, filter, sort)
|
||||
return collectionsStore.collectionsForService(providerId, serviceId)
|
||||
@@ -138,13 +135,9 @@ export const useNodesStore = defineStore('documentsNodesStore', () => {
|
||||
): Promise<EntityObject[]> {
|
||||
error.value = null
|
||||
try {
|
||||
const sources: SourceSelector = {
|
||||
[providerId]: {
|
||||
[String(serviceId)]: collectionId === null
|
||||
? true
|
||||
: { [String(collectionId)]: true },
|
||||
},
|
||||
}
|
||||
const sources: (ServiceIdentifier | CollectionIdentifier)[] = collectionId === null
|
||||
? [`${providerId}:${serviceId}`]
|
||||
: [`${providerId}:${serviceId}:${collectionId}`]
|
||||
|
||||
await entitiesStore.list(sources, filter, sort, range)
|
||||
return entitiesStore.entitiesForCollection(providerId, serviceId, collectionId)
|
||||
|
||||
Reference in New Issue
Block a user