Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/filesSharingServices.js')
-rw-r--r--src/services/filesSharingServices.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/services/filesSharingServices.js b/src/services/filesSharingServices.js
index 2b9b2f1fd..26008a1a7 100644
--- a/src/services/filesSharingServices.js
+++ b/src/services/filesSharingServices.js
@@ -55,6 +55,25 @@ const shareFile = async function(path, token, referenceId, metadata) {
}
}
+/**
+ * Share a text file to a conversation
+ *
+ * @param { string } filePath the file path
+ * @return { object } the file object
+ */
+const createTextFile = async function(filePath) {
+ try {
+ return axios.post(
+ generateOcsUrl('apps/files/api/v1/templates/create'),
+ {
+ filePath,
+ })
+ } catch (error) {
+ console.debug(error)
+ }
+}
+
export {
shareFile,
+ createTextFile,
}