mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
add folder create
This commit is contained in:
@@ -2,13 +2,14 @@ import { API_URL } from '../config'
|
||||
import socketio from 'socket.io-client'
|
||||
import auth from './auth'
|
||||
import store from './store'
|
||||
import { updateUser, updateArticle, destroyArticle } from './actions'
|
||||
import { updateUser, updateArticle, destroyArticle, destroyFolder } from './actions'
|
||||
|
||||
export const CONN = 'CONN'
|
||||
export const ALERT = 'ALERT'
|
||||
export const USER_UPDATE = 'USER_UPDATE'
|
||||
export const ARTICLE_UPDATE = 'ARTICLE_UPDATE'
|
||||
export const ARTICLE_DESTROY = 'ARTICLE_DESTROY'
|
||||
export const FOLDER_DESTROY = 'FOLDER_DESTROY'
|
||||
|
||||
let io = socketio(API_URL)
|
||||
|
||||
@@ -31,6 +32,11 @@ io.on(USER_UPDATE, function (data) {
|
||||
store.dispatch(updateUser(user))
|
||||
})
|
||||
|
||||
io.on(FOLDER_DESTROY, function (data) {
|
||||
console.log(FOLDER_DESTROY, data)
|
||||
store.dispatch(destroyFolder(data.TeamId, data.FolderId))
|
||||
})
|
||||
|
||||
io.on(ARTICLE_UPDATE, function (data) {
|
||||
console.log(ARTICLE_UPDATE, data)
|
||||
let { userId, article } = data
|
||||
|
||||
Reference in New Issue
Block a user