Skip to content

Commit a2566fa

Browse files
committed
Fix partial backport
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent d9c4ff3 commit a2566fa

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

apps/files/src/views/TemplatePicker.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,11 @@ export default {
199199
const currentDirectory = getCurrentDirectory()
200200
const fileList = OCA?.Files?.App?.currentFileList
201201
202-
try {
203-
const response = await axios.post(generateOcsUrl('apps/files/api/v1/templates', 2) + 'create', {
204-
filePath: `${currentDirectory}/${this.name}`,
205-
templatePath: this.selectedTemplate?.filename,
206-
templateType: this.selectedTemplate?.templateType,
207-
})
202+
// If the file doesn't have an extension, add the default one
203+
if (this.nameWithoutExt === this.name) {
204+
this.logger.debug('Fixed invalid filename', { name: this.name, extension: this.provider?.extension })
205+
this.name = this.name + this.provider?.extension
206+
}
208207
209208
try {
210209
const fileInfo = await createFromTemplate(

0 commit comments

Comments
 (0)