fix: contact person in masto instance endpoint
This commit is contained in:
parent
3526880607
commit
1446514442
@ -93,7 +93,7 @@ export class MastodonApiServerService {
|
|||||||
},
|
},
|
||||||
order: { id: 'ASC' },
|
order: { id: 'ASC' },
|
||||||
});
|
});
|
||||||
const contact = admin == null ? null : convertAccount((await client.getAccount(admin.id)).data);
|
const contact = admin == null ? null : convertAccount((await client.getAccount(admin.id, BASE_URL)).data);
|
||||||
reply.send(await getInstance(data.data, contact, this.config, await this.metaService.fetch()));
|
reply.send(await getInstance(data.data, contact, this.config, await this.metaService.fetch()));
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
/* console.error(e); */
|
/* console.error(e); */
|
||||||
|
@ -156,7 +156,7 @@ export interface MegalodonInterface {
|
|||||||
* @param id The account ID.
|
* @param id The account ID.
|
||||||
* @return An account.
|
* @return An account.
|
||||||
*/
|
*/
|
||||||
getAccount(id: string): Promise<Response<Entity.Account>>
|
getAccount(id: string, host?: string): Promise<Response<Entity.Account>>
|
||||||
/**
|
/**
|
||||||
* Statuses posted to the given account.
|
* Statuses posted to the given account.
|
||||||
*
|
*
|
||||||
|
@ -266,14 +266,14 @@ export default class Misskey implements MegalodonInterface {
|
|||||||
/**
|
/**
|
||||||
* POST /api/users/show
|
* POST /api/users/show
|
||||||
*/
|
*/
|
||||||
public async getAccount(id: string): Promise<Response<Entity.Account>> {
|
public async getAccount(id: string, host?: string): Promise<Response<Entity.Account>> {
|
||||||
return this.client
|
return this.client
|
||||||
.post<MisskeyAPI.Entity.UserDetail>('/api/users/show', {
|
.post<MisskeyAPI.Entity.UserDetail>('/api/users/show', {
|
||||||
userId: id
|
userId: id
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
return Object.assign(res, {
|
return Object.assign(res, {
|
||||||
data: MisskeyAPI.Converter.userDetail(res.data)
|
data: MisskeyAPI.Converter.userDetail(res.data, host)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user