mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-12 21:53:09 +02:00
upd: move patch function and make note user always detail
This commit is contained in:
parent
1e02899de7
commit
a847e4d5cc
4 changed files with 4 additions and 15 deletions
|
@ -310,7 +310,7 @@ export class NoteEntityService implements OnModuleInit {
|
||||||
createdAt: note.createdAt.toISOString(),
|
createdAt: note.createdAt.toISOString(),
|
||||||
userId: note.userId,
|
userId: note.userId,
|
||||||
user: this.userEntityService.pack(note.user ?? note.userId, me, {
|
user: this.userEntityService.pack(note.user ?? note.userId, me, {
|
||||||
detail: false,
|
detail: true,
|
||||||
}),
|
}),
|
||||||
text: text,
|
text: text,
|
||||||
cw: note.cw,
|
cw: note.cw,
|
||||||
|
|
|
@ -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
|
const client = getClient(BASE_URL, accessTokens); // we are using this here, because in private mode some info isnt
|
||||||
// displayed without being logged in
|
// displayed without being logged in
|
||||||
try {
|
try {
|
||||||
const account = new ApiAccountMastodon(_request, client, BASE_URL);
|
const data = await client.updateCredentials(_request.body!);
|
||||||
reply.send(await account.updateCredentials());
|
reply.send(convertAccount(data.data));
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
/* console.error(e); */
|
/* console.error(e); */
|
||||||
reply.code(401).send(e.response.data);
|
reply.code(401).send(e.response.data);
|
||||||
|
|
|
@ -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() {
|
public async lookup() {
|
||||||
try {
|
try {
|
||||||
const data = await this.client.search((this.request.query as any).acct, { type: 'accounts' });
|
const data = await this.client.search((this.request.query as any).acct, { type: 'accounts' });
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace MisskeyEntity {
|
||||||
id: string
|
id: string
|
||||||
createdAt: string
|
createdAt: string
|
||||||
userId: string
|
userId: string
|
||||||
user: User
|
user: UserDetail
|
||||||
text: string | null
|
text: string | null
|
||||||
cw: string | null
|
cw: string | null
|
||||||
visibility: 'public' | 'home' | 'followers' | 'specified'
|
visibility: 'public' | 'home' | 'followers' | 'specified'
|
||||||
|
|
Loading…
Reference in a new issue