add new database api

This commit is contained in:
ammarahm-ed
2020-02-06 13:08:35 +05:00
parent 2e59886d26
commit 9f7319b6bb
20 changed files with 146 additions and 155 deletions

View File

@@ -24,7 +24,8 @@ export class AddTopicDialog extends React.Component {
if (!this.title)
return ToastEvent.show('Title is required', 'error', 3000, () => {}, '');
db.addTopicToNotebook(this.props.notebookID, this.title);
await db.notebooks.notebook(this.props.notebookID).topics.add(this.title);
eSendEvent(eOnNewTopicAdded);
ToastEvent.show('New topic added', 'success', 3000, () => {}, '');
this.close();