fix(client): Fix bug that cannot post when image only

This commit is contained in:
syuilo 2020-04-19 17:40:46 +09:00
parent 24a83de22d
commit fd034ba176

View File

@ -75,7 +75,7 @@ export default Vue.extend({
this.posting = true; this.posting = true;
const file = this.value.attachCanvasImage ? await this.upload() : null; const file = this.value.attachCanvasImage ? await this.upload() : null;
this.$root.api('notes/create', { this.$root.api('notes/create', {
text: this.text, text: this.text === '' ? null : this.text,
fileIds: file ? [file.id] : undefined, fileIds: file ? [file.id] : undefined,
}).then(() => { }).then(() => {
this.posted = true; this.posted = true;