Johann150
36a0e48e49
All checks were successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
There are still many places where import paths with `..` are used and maybe should use absolute paths also.
19 lines
542 B
TypeScript
19 lines
542 B
TypeScript
import { Notes } from '@/models/index.js';
|
|
import { CacheableRemoteUser } from '@/models/entities/user.js';
|
|
import deleteNote from '@/services/note/delete.js';
|
|
import { IAnnounce, getApId } from '@/remote/activitypub/type.js';
|
|
|
|
export const undoAnnounce = async (actor: CacheableRemoteUser, activity: IAnnounce): Promise<string> => {
|
|
const uri = getApId(activity);
|
|
|
|
const note = await Notes.findOneBy({
|
|
uri,
|
|
userId: actor.id,
|
|
});
|
|
|
|
if (!note) return 'skip: no such Announce';
|
|
|
|
await deleteNote(actor, note);
|
|
return 'ok: deleted';
|
|
};
|