import { API } from '../core/api' ; import { Comment , CommentList , Block } from '../models' ; extends API export default class Comments extends API { param block param body returns async add ( block , body ) { const response = await this . sendPost ( `blocks/${ block }/comments` , [ body ] ) ; return response . json ( ) as Promise < Comment > ; } param id returns async get ( id ) { const response = await this . sendGet ( `blocks/${ id }/comment` ) ; return response . json ( ) as Promise < Comment > ; } param block returns async list ( block ) { const response = await this . sendGet ( `blocks/${ block }/comments` ) ; return response . json ( ) as Promise < CommentList > ; } param id returns async ignore ( id ) { const response = await this . sendDelete ( `blocks/${ id }` ) ; return response . json ( ) as Promise < Block > ; } }