mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
40 lines
657 B
JavaScript
40 lines
657 B
JavaScript
export const SELECT_ARTICLE = 'SELECT_ARTICLE'
|
|
export const SEARCH_ARTICLE = 'SEARCH_ARTICLE'
|
|
export const REFRESH_DATA = 'REFRESH_DATA'
|
|
|
|
export function selectArticle (key) {
|
|
return {
|
|
type: SELECT_ARTICLE,
|
|
data: { key }
|
|
}
|
|
}
|
|
|
|
export function searchArticle (input) {
|
|
return {
|
|
type: SEARCH_ARTICLE,
|
|
data: { input }
|
|
}
|
|
}
|
|
|
|
export function refreshData (data) {
|
|
console.log('refreshing data')
|
|
let { folders, articles } = data
|
|
|
|
return {
|
|
type: REFRESH_DATA,
|
|
data: {
|
|
articles,
|
|
folders
|
|
}
|
|
}
|
|
}
|
|
|
|
export default {
|
|
SELECT_ARTICLE,
|
|
SEARCH_ARTICLE,
|
|
REFRESH_DATA,
|
|
selectArticle,
|
|
searchArticle,
|
|
refreshData
|
|
}
|