Merge pull request #237 from h3poteto/conversation

Fix response for conversation API
This commit is contained in:
AkiraFukushima 2020-03-04 00:13:39 +09:00 committed by GitHub
commit c45f3d9ace
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -1479,7 +1479,7 @@ export default class Mastodon implements MegalodonInterface {
max_id?: string | null,
since_id?: string | null,
min_id?: string | null
): Promise<Response<Array<Entity.Status>>> {
): Promise<Response<Array<Entity.Conversation>>> {
let params = {}
if (max_id) {
params = Object.assign(params, {
@ -1501,9 +1501,9 @@ export default class Mastodon implements MegalodonInterface {
limit: limit
})
}
return this.client.get<Array<MastodonAPI.Entity.Status>>('/api/v1/conversations', params).then(res => {
return this.client.get<Array<MastodonAPI.Entity.Conversation>>('/api/v1/conversations', params).then(res => {
return Object.assign(res, {
data: res.data.map(s => MastodonAPI.Converter.status(s))
data: res.data.map(c => MastodonAPI.Converter.conversation(c))
})
})
}

View file

@ -861,7 +861,7 @@ export interface MegalodonInterface {
max_id?: string | null,
since_id?: string | null,
min_id?: string | null
): Promise<Response<Array<Entity.Status>>>
): Promise<Response<Array<Entity.Conversation>>>
/**
* DELETE /api/v1/conversations/:id
*