mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
enhance(libs): add get_file_content function for retrieving file content
This commit is contained in:
@@ -924,6 +924,7 @@ export interface IDBProxy {
|
||||
* @param content
|
||||
*/
|
||||
setFileContent: (path: string, content: string) => Promise<void>
|
||||
getFileContent: (path: string) => Promise<string | null>
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
(def ^:export datascript_query api-db/datascript_query)
|
||||
(def ^:export custom_query api-db/custom_query)
|
||||
(def ^:export set_file_content api-db/set_file_content)
|
||||
(def ^:export get_file_content api-db/get_file_content)
|
||||
|
||||
;; editor
|
||||
(def ^:export prepend_block_in_page api-editor/prepend_block_in_page)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
(:require [cljs-bean.core :as bean]
|
||||
[cljs.reader]
|
||||
[frontend.db :as db]
|
||||
[frontend.db.model :as db-model]
|
||||
[frontend.db.async :as db-async]
|
||||
[frontend.db.query-custom :as query-custom]
|
||||
[frontend.db.query-dsl :as query-dsl]
|
||||
@@ -67,3 +68,7 @@
|
||||
(db/transact! [{:file/path path
|
||||
:file/content content}])
|
||||
true))))
|
||||
|
||||
(defn get_file_content
|
||||
[path]
|
||||
(db-model/get-file path))
|
||||
|
||||
Reference in New Issue
Block a user