mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 02:36:36 +00:00
change how to use dataApi and fix indent
This commit is contained in:
@@ -148,20 +148,9 @@ class StorageItem extends React.Component {
|
||||
const noteData = JSON.parse(e.dataTransfer.getData('note'))
|
||||
const newNoteData = Object.assign({}, noteData, {storage: storage, folder: folder.key})
|
||||
if(folder.key === noteData.folder) return
|
||||
console.log(location)
|
||||
dataApi
|
||||
.createNote(storage.key, newNoteData)
|
||||
.then((note) => {
|
||||
dispatch({
|
||||
type: 'UPDATE_NOTE',
|
||||
note: note
|
||||
})
|
||||
hashHistory.push({
|
||||
pathname: location.pathname,
|
||||
query: {key: note.storage + '-' + note.key}
|
||||
})
|
||||
})
|
||||
|
||||
dataApi
|
||||
.deleteNote(noteData.storage, noteData.key)
|
||||
.then((data) => {
|
||||
@@ -175,7 +164,18 @@ class StorageItem extends React.Component {
|
||||
eventEmitter.once('list:moved', dispatchHandler)
|
||||
eventEmitter.emit('list:next')
|
||||
})
|
||||
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
dispatch({
|
||||
type: 'UPDATE_NOTE',
|
||||
note: note
|
||||
})
|
||||
hashHistory.push({
|
||||
pathname: location.pathname,
|
||||
query: {key: note.storage + '-' + note.key}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
render () {
|
||||
|
||||
Reference in New Issue
Block a user