Skip to content

Commit

Permalink
Fix partial backport
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Sep 20, 2021
1 parent 265aedc commit f49e023
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions apps/files/src/views/TemplatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,11 @@ export default {
const currentDirectory = getCurrentDirectory()
const fileList = OCA?.Files?.App?.currentFileList

try {
const response = await axios.post(generateOcsUrl('apps/files/api/v1/templates', 2) + 'create', {
filePath: `${currentDirectory}/${this.name}`,
templatePath: this.selectedTemplate?.filename,
templateType: this.selectedTemplate?.templateType,
})
// If the file doesn't have an extension, add the default one
if (this.nameWithoutExt === this.name) {
this.logger.debug('Fixed invalid filename', { name: this.name, extension: this.provider?.extension })
this.name = this.name + this.provider?.extension
}

try {
const fileInfo = await createFromTemplate(
Expand Down

0 comments on commit f49e023

Please sign in to comment.