Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some endpoint for misskey #271

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/misskey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export default class Misskey implements MegalodonInterface {
): Promise<Response<Array<Entity.Status>>> {
if (options && options.pinned) {
return this.client
.post<MisskeyAPI.Entity.UserDetail>('/api/usres/show', {
.post<MisskeyAPI.Entity.UserDetail>('/api/users/show', {
userId: id
})
.then(res => {
Expand Down Expand Up @@ -406,9 +406,9 @@ export default class Misskey implements MegalodonInterface {
})
}
}
return this.client.post<Array<MisskeyAPI.Entity.Follower>>('/api/users/following', params).then(res => {
return this.client.post<Array<MisskeyAPI.Entity.Following>>('/api/users/following', params).then(res => {
return Object.assign(res, {
data: res.data.map(f => MisskeyAPI.Converter.follower(f))
data: res.data.map(f => MisskeyAPI.Converter.following(f))
})
})
}
Expand All @@ -431,7 +431,7 @@ export default class Misskey implements MegalodonInterface {
* POST /api/following/create
*/
public async followAccount(id: string, _reblog?: boolean): Promise<Response<Entity.Relationship>> {
await this.client.post<{}>('api/following/create', {
await this.client.post<{}>('/api/following/create', {
userId: id
})
return this.client
Expand All @@ -449,7 +449,7 @@ export default class Misskey implements MegalodonInterface {
* POST /api/following/delete
*/
public async unfollowAccount(id: string): Promise<Response<Entity.Relationship>> {
await this.client.post<{}>('api/following/delete', {
await this.client.post<{}>('/api/following/delete', {
userId: id
})
return this.client
Expand All @@ -467,7 +467,7 @@ export default class Misskey implements MegalodonInterface {
* POST /api/blocking/create
*/
public async blockAccount(id: string): Promise<Response<Entity.Relationship>> {
await this.client.post<{}>('api/blocking/create', {
await this.client.post<{}>('/api/blocking/create', {
userId: id
})
return this.client
Expand All @@ -485,7 +485,7 @@ export default class Misskey implements MegalodonInterface {
* POST /api/blocking/delete
*/
public async unblockAccount(id: string): Promise<Response<Entity.Relationship>> {
await this.client.post<{}>('api/blocking/delete', {
await this.client.post<{}>('/api/blocking/delete', {
userId: id
})
return this.client
Expand All @@ -503,7 +503,7 @@ export default class Misskey implements MegalodonInterface {
* POST /api/mute/create
*/
public async muteAccount(id: string, _notifications: boolean): Promise<Response<Entity.Relationship>> {
await this.client.post<{}>('api/mute/create', {
await this.client.post<{}>('/api/mute/create', {
userId: id
})
return this.client
Expand All @@ -521,7 +521,7 @@ export default class Misskey implements MegalodonInterface {
* POST /api/mute/delete
*/
public async unmuteAccount(id: string): Promise<Response<Entity.Relationship>> {
await this.client.post<{}>('api/mute/delete', {
await this.client.post<{}>('/api/mute/delete', {
userId: id
})
return this.client
Expand Down