diff --git a/lib/api/user.ts b/lib/api/user.ts index b8249f4..b862d88 100644 --- a/lib/api/user.ts +++ b/lib/api/user.ts @@ -67,6 +67,11 @@ export async function getFirstUser(): Promise { projection: { _id: 0, emailVerified: 0 } } ); + + if (!results) { + throw new Error('Please run "npm run setup" to insert testing records'); + } + return { ...results, bioMdx: await getMdxSource(results.bio || placeholderBio) @@ -123,7 +128,7 @@ export async function searchUser(query: string): Promise { { $search: { index: 'name-index', - /* + /* name-index is a search index as follows: {