wip: fix bug and remove unused property

This commit is contained in:
GrapeApple0 2024-07-23 10:49:59 +00:00
parent fdde072614
commit f7b954aead
2 changed files with 6 additions and 6 deletions

View File

@ -595,10 +595,10 @@ export class ApRendererService {
} }
@bindThis @bindThis
public renderNoteUpdate(object: IPost, note: MiNote, user: { id: MiUser['id'] }): IUpdate { public renderNoteUpdate(object: IPost, user: { id: MiUser['id'] }): IUpdate {
const activity: IUpdate = { const activity: IUpdate = {
id: `${this.config.url}/users/${user.id}#updates/${new Date().getTime()}`, id: `${this.config.url}/users/${user.id}#updates/${new Date().getTime()}`,
actor: this.userEntityService.genLocalUserUri(note.userId), actor: this.userEntityService.genLocalUserUri(user.id),
type: 'Update', type: 'Update',
published: new Date().toISOString(), published: new Date().toISOString(),
object, object,

View File

@ -399,15 +399,15 @@ describe('ActivityPub', () => {
content: 'あ', content: 'あ',
}; };
resolver.register(actor.id, actor);
resolver.register(post.id, post);
const note = { const note = {
...(await noteService.createNote(post.id, resolver, true))!, ...(await noteService.createNote(post.id, resolver, true))!,
updatedAt: new Date(), updatedAt: new Date(),
}; };
resolver.register(actor.id, actor); rendererService.renderNoteUpdate(await rendererService.renderNote(note, false, true), actor);
resolver.register(post.id, post);
rendererService.renderNoteUpdate(await rendererService.renderNote(note, false, true), note, actor);
}); });
}); });