mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-23 10:27:28 -07:00
Fix bug
This commit is contained in:
parent
0480c7f116
commit
3348094e5f
3 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import User, { IRemoteUser } from '../../../models/user';
|
||||
import config from '../../../config';
|
||||
import follow from '../../../services/following/create';
|
||||
|
@ -10,7 +11,9 @@ export default async (actor: IRemoteUser, activity: IFollow): Promise<void> => {
|
|||
return null;
|
||||
}
|
||||
|
||||
const followee = await User.findOne({ _id: id.split('/').pop() });
|
||||
const followee = await User.findOne({
|
||||
_id: new mongo.ObjectID(id.split('/').pop())
|
||||
});
|
||||
|
||||
if (followee === null) {
|
||||
throw new Error('followee not found');
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import Note from '../../../models/note';
|
||||
import { IRemoteUser } from '../../../models/user';
|
||||
import { ILike } from '../type';
|
||||
|
@ -9,7 +10,7 @@ export default async (actor: IRemoteUser, activity: ILike) => {
|
|||
// Transform:
|
||||
// https://misskey.ex/notes/xxxx to
|
||||
// xxxx
|
||||
const noteId = id.split('/').pop();
|
||||
const noteId = new mongo.ObjectID(id.split('/').pop());
|
||||
|
||||
const note = await Note.findOne({ _id: noteId });
|
||||
if (note === null) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import User, { IRemoteUser } from '../../../../models/user';
|
||||
import config from '../../../../config';
|
||||
import unfollow from '../../../../services/following/delete';
|
||||
|
@ -10,7 +11,9 @@ export default async (actor: IRemoteUser, activity: IFollow): Promise<void> => {
|
|||
return null;
|
||||
}
|
||||
|
||||
const followee = await User.findOne({ _id: id.split('/').pop() });
|
||||
const followee = await User.findOne({
|
||||
_id: new mongo.ObjectID(id.split('/').pop())
|
||||
});
|
||||
|
||||
if (followee === null) {
|
||||
throw new Error('followee not found');
|
||||
|
|
Loading…
Reference in a new issue