Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NewMessageNewFileDialog) - fix creation of file from Blank template #9812

Merged
merged 2 commits into from Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/components/NewMessage/NewMessageNewFileDialog.vue
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/services/filesSharingServices.js
Expand Up @@ -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) {
Expand Down