mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-05 17:27:41 +02:00
fix: revert document content field rename (#6955)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
//
|
||||
//
|
||||
|
||||
import { Doc, concatLink } from '@hcengineering/core'
|
||||
import { Document, documentId } from '@hcengineering/document'
|
||||
import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref, concatLink } from '@hcengineering/core'
|
||||
import document, { Document, documentId } from '@hcengineering/document'
|
||||
import { getMetadata } from '@hcengineering/platform'
|
||||
import { workbenchId } from '@hcengineering/workbench'
|
||||
import serverCore, { TriggerControl } from '@hcengineering/server-core'
|
||||
@@ -38,11 +38,27 @@ export async function documentTextPresenter (doc: Doc): Promise<string> {
|
||||
return document.title
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export async function findChildDocuments (
|
||||
doc: Doc,
|
||||
hiearachy: Hierarchy,
|
||||
findAll: <T extends Doc>(
|
||||
clazz: Ref<Class<T>>,
|
||||
query: DocumentQuery<T>,
|
||||
options?: FindOptions<T>
|
||||
) => Promise<FindResult<T>>
|
||||
): Promise<Doc[]> {
|
||||
return await findAll(document.class.Document, { parent: doc._id as Ref<Document> })
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||
export default async () => ({
|
||||
function: {
|
||||
DocumentHTMLPresenter: documentHTMLPresenter,
|
||||
DocumentTextPresenter: documentTextPresenter,
|
||||
DocumentLinkIdProvider: documentLinkIdProvider
|
||||
DocumentLinkIdProvider: documentLinkIdProvider,
|
||||
FindChildDocuments: findChildDocuments
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user