import Axios from '../ourAxios' ; export default { user : { signUp : ( userData ) => Axios . post ( '/api/v1/users/signup' , userData ) . then ( ( res ) => res . data ) , autoLogin : ( ) => Axios . get ( '/api/v1/users/auth' ) . then ( ( res ) => res . data ) , logOut : ( ) => Axios . get ( '/api/v1/users/logout' ) . then ( ( res ) => res . data ) , logIn : ( userData ) => Axios . post ( '/api/v1/users/login' , userData ) . then ( ( res ) => res . data ) , currentUser : ( ) => Axios . get ( '/api/v1/users/currentUser' ) . then ( ( res ) => res . data ) , editProfile : ( ) => Axios . get ( '/api/v1/users/editProfile' ) . then ( ( res ) => res . data ) , getProfile : ( username ) => Axios . get ( `/api/v1/users/profile/${ username }` ) . then ( ( res ) => res . data ) , followUser : ( username ) => Axios . post ( `/api/v1/users/followUser/${ username }` ) . then ( ( res ) => res . data ) , unfollowUser : ( username ) => Axios . delete ( `/api/v1/users/unfollowUser/${ username }` ) . then ( ( res ) => res . data ) , resendConfirmation : ( ) => Axios . post ( '/api/v1/users/resendConfirmation' ) . then ( ( res ) => res . data ) , emailConfirmation : ( userId , token ) => Axios . get ( `/api/v1/users/emailConfirmation/${ userId }/${ token }` ) . then ( ( res ) => res . data ) , updateProfile : ( userData ) => Axios . put ( '/api/v1/users/updateProfile' , userData ) . then ( ( res ) => res . data ) , getNotifications : ( id ) => Axios . get ( `/api/v1/notifications/${ id }` ) . then ( ( res ) => res . data ) , markAsRead : ( id ) => Axios . post ( `/api/v1/notifications/markAsRead/${ id }` ) . then ( ( res ) => res . data ) , } , post : { createPost : ( postData ) => Axios . post ( '/api/v1/posts/createPost' , postData ) . then ( ( res ) => res . data ) , repost : ( id , userId ) => Axios . post ( `/api/v1/posts/repost/${ userId }/${ id }` ) . then ( ( res ) => res . data ) , unrepost : ( id , userId ) => Axios . delete ( `/api/v1/posts/unRepost/${ userId }/${ id }` ) . then ( ( res ) => res . data ) , getPosts : ( ) => Axios . get ( '/api/v1/posts/getPosts' ) . then ( ( res ) => res . data ) , likePost : ( id ) => Axios . post ( `/api/v1/posts/likePost/${ id }` ) . then ( ( res ) => res . data ) , deletePost : ( id , userId ) => Axios . delete ( `/api/v1/posts/deletePost/${ userId }/${ id }` ) . then ( ( res ) => res . data ) , getPost : ( id ) => Axios . get ( `/api/v1/posts/post/${ id }` ) . then ( ( res ) => res . data ) , dislikePost : ( id ) => Axios . post ( `/api/v1/posts/dislikePost/${ id }` ) . then ( ( res ) => res . data ) , postComment : ( commentData ) => Axios . post ( '/api/v1/posts/postComment' , commentData ) . then ( ( res ) => res . data ) , deleteComment : ( id , userId ) => Axios . delete ( `/api/v1/posts/deleteComment/${ userId }/${ id }` ) . then ( ( res ) => res . data ) , editComment : ( id , userId , commentData ) => Axios . put ( `/api/v1/posts/editComment/${ userId }/${ id }` , commentData ) . then ( ( res ) => res . data ) , replyComment : ( postId , commentId , replyData ) => Axios . post ( `/api/v1/posts/replyComment/${ postId }/${ commentId }` , replyData ) . then ( ( res ) => res . data ) , deleteReply : ( postId , commentId , userId ) => Axios . delete ( `/api/v1/posts/deleteReply/${ postId }/${ userId }/${ commentId }` ) . then ( ( res ) => res . data ) , searchPosts : ( query ) => Axios . get ( `/api/v1/posts/searchq=${ query }` ) . then ( ( res ) => res . data ) , searchPostsNull : ( query ) => Axios . get ( `/api/v1/posts/searchq=${ query }` ) . then ( ( res ) => res . data ) , } , } ;