upd: move patch function and make note user always detail

This commit is contained in:
Mar0xy 2023-09-25 21:10:49 +02:00
parent 1e02899de7
commit a847e4d5cc
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
4 changed files with 4 additions and 15 deletions

View file

@ -242,8 +242,8 @@ export class MastodonApiServerService {
const client = getClient(BASE_URL, accessTokens); // we are using this here, because in private mode some info isnt
// displayed without being logged in
try {
const account = new ApiAccountMastodon(_request, client, BASE_URL);
reply.send(await account.updateCredentials());
const data = await client.updateCredentials(_request.body!);
reply.send(convertAccount(data.data));
} catch (e: any) {
/* console.error(e); */
reply.code(401).send(e.response.data);

View file

@ -58,17 +58,6 @@ export class ApiAccountMastodon {
}
}
public async updateCredentials() {
try {
const data = await this.client.updateCredentials(this.request.body as any);
return convertAccount(data.data);
} catch (e: any) {
/* console.error(e);
console.error(e.response.data); */
return e.response;
}
}
public async lookup() {
try {
const data = await this.client.search((this.request.query as any).acct, { type: 'accounts' });