mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-16 11:15:12 +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 noteData = JSON.parse(e.dataTransfer.getData('note'))
|
||||||
const newNoteData = Object.assign({}, noteData, {storage: storage, folder: folder.key})
|
const newNoteData = Object.assign({}, noteData, {storage: storage, folder: folder.key})
|
||||||
if(folder.key === noteData.folder) return
|
if(folder.key === noteData.folder) return
|
||||||
console.log(location)
|
|
||||||
dataApi
|
dataApi
|
||||||
.createNote(storage.key, newNoteData)
|
.createNote(storage.key, newNoteData)
|
||||||
.then((note) => {
|
.then((note) => {
|
||||||
dispatch({
|
|
||||||
type: 'UPDATE_NOTE',
|
|
||||||
note: note
|
|
||||||
})
|
|
||||||
hashHistory.push({
|
|
||||||
pathname: location.pathname,
|
|
||||||
query: {key: note.storage + '-' + note.key}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
dataApi
|
dataApi
|
||||||
.deleteNote(noteData.storage, noteData.key)
|
.deleteNote(noteData.storage, noteData.key)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
@@ -175,7 +164,18 @@ class StorageItem extends React.Component {
|
|||||||
eventEmitter.once('list:moved', dispatchHandler)
|
eventEmitter.once('list:moved', dispatchHandler)
|
||||||
eventEmitter.emit('list:next')
|
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 () {
|
render () {
|
||||||
|
|||||||
Reference in New Issue
Block a user