desc author veaba
 *  date import { getAllList , insertOne , isHasOne } from "../mongo/curd" ; import { _pushSuccess } from "../app" ; import { _authUser } from "../utils/utils" ; export const getTimeline = async ( socket , sid , data , channel , eventName ) => { const timelineList = await getAllList ( { } , 'timelines' ) ; await _pushSuccess ( channel , 'getTimeline' , timelineList ) ; } ; desc export const _saveTimeline = async ( socket , sid , data , channel , eventName ) => { await _authUser ( socket , sid , data , channel , eventName , 'noAuth' ) ; const canSave = await isHasOne ( { _id : data . _id , newsUrl : data . newsUrl } , 'timelines' ) ; if ( ! canSave ) { await insertOne ( data , 'timelines' ) ; } } ;