Supports Array ActivityStreams type (#7536)

* Supports Array type

* Fix

* Fix Service to Note

* Update type.ts

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
MeiMei
2021-05-31 13:04:13 +09:00
committed by GitHub
parent b608f63a1a
commit caf40e40fb
10 changed files with 76 additions and 82 deletions

View File

@@ -3,14 +3,15 @@ import { IRemoteUser } from '../../../../models/entities/user';
import { IAnnounce, getApId } from '../../type';
import deleteNote from '../../../../services/note/delete';
export const undoAnnounce = async (actor: IRemoteUser, activity: IAnnounce): Promise<void> => {
export const undoAnnounce = async (actor: IRemoteUser, activity: IAnnounce): Promise<string> => {
const uri = getApId(activity);
const note = await Notes.findOne({
uri
});
if (!note) return;
if (!note) return 'skip: no such Announce';
await deleteNote(actor, note);
return 'ok: deleted';
};