summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2023-06-20 10:00:40 +0200
committerGitHub <noreply@github.com>2023-06-20 10:00:40 +0200
commit8a0ee07094bde9542250a495d6f157be2cdba9e4 (patch)
treeaf2d9001f8decdfa36f9e2158ad34265031bef19
parent0552272ca3f41e9d4f945c2ed1f961a1d2b14014 (diff)
parentb0bdc91e2264097982e7dc48f65a96e3c0a5f64b (diff)
Merge pull request #9818 from nextcloud/backport/9812/stable27
[stable27] fix(NewMessageNewFileDialog) - fix creation of file from Blank template
-rw-r--r--src/components/NewMessage/NewMessageNewFileDialog.vue12
-rw-r--r--src/services/filesSharingServices.js4
2 files changed, 9 insertions, 7 deletions
diff --git a/src/components/NewMessage/NewMessageNewFileDialog.vue b/src/components/NewMessage/NewMessageNewFileDialog.vue
index 6033a0865..8eb2e5a3e 100644
--- a/src/components/NewMessage/NewMessageNewFileDialog.vue
+++ b/src/components/NewMessage/NewMessageNewFileDialog.vue
@@ -210,11 +210,13 @@ export default {
let fileData
try {
- const response = await createNewFile(
- filePath,
- this.selectedTemplate?.filename,
- this.selectedTemplate?.templateType,
- )
+ const response = this.selectedTemplate.fileid === -1
+ ? await createNewFile(filePath)
+ : await createNewFile(
+ filePath,
+ this.selectedTemplate?.filename,
+ this.selectedTemplate?.templateType,
+ )
fileData = response.data.ocs.data
} catch (error) {
console.error('Error while creating file', error)
diff --git a/src/services/filesSharingServices.js b/src/services/filesSharingServices.js
index 62777d425..4da0a2108 100644
--- a/src/services/filesSharingServices.js
+++ b/src/services/filesSharingServices.js
@@ -63,8 +63,8 @@ const getFileTemplates = async () => {
* Share a text file to a conversation
*
* @param {string} filePath The new file destination path
- * @param {string} templatePath The template source path
- * @param {string} templateType The template type e.g 'user'
+ * @param {string} [templatePath] The template source path
+ * @param {string} [templateType] The template type e.g 'user'
* @return { object } the file object
*/
const createNewFile = async function(filePath, templatePath, templateType) {