Skip to content
Snippets Groups Projects
Commit d892e660 authored by syuilo's avatar syuilo
Browse files

Fix bug

parent ff5ab7d1
No related branches found
No related tags found
No related merge requests found
import * as mongo from 'mongodb';
import { JSDOM } from 'jsdom';
import * as debug from 'debug';
......@@ -22,7 +23,8 @@ export async function fetchNote(value: string | IObject, resolver?: Resolver): P
// URIがこのサーバーを指しているならデータベースからフェッチ
if (uri.startsWith(config.url + '/')) {
return await Note.findOne({ _id: uri.split('/').pop() });
const id = new mongo.ObjectID(uri.split('/').pop());
return await Note.findOne({ _id: id });
}
//#region このサーバーに既に登録されていたらそれを返す
......
import * as mongo from 'mongodb';
import { JSDOM } from 'jsdom';
import { toUnicode } from 'punycode';
import * as debug from 'debug';
......@@ -21,7 +22,8 @@ export async function fetchPerson(value: string | IObject, resolver?: Resolver):
// URIがこのサーバーを指しているならデータベースからフェッチ
if (uri.startsWith(config.url + '/')) {
return await User.findOne({ _id: uri.split('/').pop() });
const id = new mongo.ObjectID(uri.split('/').pop());
return await User.findOne({ _id: id });
}
//#region このサーバーに既に登録されていたらそれを返す
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment