import API from './APIUtils' ; import { IComment } from '../types' ; type Comment = { comment : IComment ; } ; type Comments = { comments : Array < IComment > ; } ; export function createComment ( slug , comment ) { return API . post < Comment > ( `/articles/${ slug }/comments` , { comment } ) ; } export function deleteComment ( slug , commentId ) { return API . delete < null > ( `/articles/${ slug }/comments/${ commentId }` ) ; } export function getArticleComments ( slug ) { return API . get < Comments > ( `/articles/${ slug }/comments` ) ; }