mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-23 12:52:24 +02:00
25 lines
485 B
TypeScript
25 lines
485 B
TypeScript
import {
|
|
Class,
|
|
Doc,
|
|
DocumentQuery,
|
|
FindOptions,
|
|
FindResult,
|
|
MeasureContext,
|
|
Ref,
|
|
ServerStorage
|
|
} from '@hcengineering/core'
|
|
|
|
/**
|
|
* @public
|
|
*/
|
|
export function createFindAll (storage: ServerStorage): ServerStorage['findAll'] {
|
|
return async <T extends Doc>(
|
|
ctx: MeasureContext,
|
|
clazz: Ref<Class<T>>,
|
|
query: DocumentQuery<T>,
|
|
options?: FindOptions<T>
|
|
): Promise<FindResult<T>> => {
|
|
return await storage.findAll(ctx, clazz, query, options)
|
|
}
|
|
}
|