diff options
Diffstat (limited to 'src/services/CommentService.ts')
-rw-r--r-- | src/services/CommentService.ts | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/services/CommentService.ts b/src/services/CommentService.ts index 2faaa8db..6f054c72 100644 --- a/src/services/CommentService.ts +++ b/src/services/CommentService.ts @@ -2,7 +2,7 @@ import AsyncStorage from '@react-native-community/async-storage'; import {Alert} from 'react-native'; import {COMMENTS_ENDPOINT, COMMENT_THREAD_ENDPOINT} from '../constants'; import {ERROR_FAILED_TO_COMMENT} from '../constants/strings'; -import {CommentType} from '../types'; +import {CommentBaseType, CommentType} from '../types'; export const getComments = async ( objectId: string, @@ -116,3 +116,19 @@ export const deleteComment = async (id: string, isThread: boolean) => { return false; } }; + +/** + * If `user_reaction` is undefined, we like the comment, if `user_reaction` + * is defined, we unlike the comment. + * + * @param comment the comment object + * @returns + */ +export const handleLikeUnlikeComment = async (comment: CommentBaseType) => { + try { + return undefined; + } catch (error) { + console.log('Unable to like/unlike a comment'); + console.error(error); + } +}; |