import { API } from '../core/api' ; import { Like , LikeList , Block } from '../models' ; extends API export default class Likes extends API { param block returns async add ( block ) { const response = await this . sendPost ( `blocks/${ block }/likes` ) ; return response . json ( ) as Promise < Like > ; } param id returns async get ( id ) { const response = await this . sendGet ( `blocks/${ id }/like` ) ; return response . json ( ) as Promise < Like > ; } param block returns async list ( block ) { const response = await this . sendGet ( `blocks/${ block }/likes` ) ; return response . json ( ) as Promise < LikeList > ; } param id returns async ignore ( id ) { const response = await this . sendDelete ( `blocks/${ id }` ) ; return response . json ( ) as Promise < Block > ; } }