Fix bug
This commit is contained in:
		
							parent
							
								
									ff5ab7d12f
								
							
						
					
					
						commit
						d892e66072
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		|  | @ -1,3 +1,4 @@ | |||
| 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 このサーバーに既に登録されていたらそれを返す
 | ||||
|  |  | |||
|  | @ -1,3 +1,4 @@ | |||
| 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 このサーバーに既に登録されていたらそれを返す
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue