diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2023-06-20 09:15:44 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-06-20 07:27:56 +0000 |
commit | b0bdc91e2264097982e7dc48f65a96e3c0a5f64b (patch) | |
tree | af2d9001f8decdfa36f9e2158ad34265031bef19 /src | |
parent | c2b6fd760cfeb9782eff9411d7a58f7867689c1b (diff) |
replace if-else block with ternary operator
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/NewMessage/NewMessageNewFileDialog.vue | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/components/NewMessage/NewMessageNewFileDialog.vue b/src/components/NewMessage/NewMessageNewFileDialog.vue index 7ad98ffa0..8eb2e5a3e 100644 --- a/src/components/NewMessage/NewMessageNewFileDialog.vue +++ b/src/components/NewMessage/NewMessageNewFileDialog.vue @@ -210,17 +210,13 @@ export default { let fileData try { - let response - if (this.selectedTemplate.fileid === -1) { - // Don't send template information for Blank - response = await createNewFile(filePath) - } else { - response = await createNewFile( + 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) |