File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,19 @@ export const getRepos = async (query: any = {}): Promise<Repo[]> => {
1616export const getRepo = async ( name : string ) : Promise < Repo | null > => {
1717 name = name . toLowerCase ( ) ;
1818 const collection = await connect ( collectionName ) ;
19- const doc = collection . findOne ( { name : { $eq : name } } ) ;
19+ const doc = await collection . findOne ( { name : { $eq : name } } ) ;
2020 return doc ? toClass ( doc , Repo . prototype ) : null ;
2121} ;
2222
2323export const getRepoByUrl = async ( repoUrl : string ) : Promise < Repo | null > => {
2424 const collection = await connect ( collectionName ) ;
25- const doc = collection . findOne ( { name : { $eq : repoUrl . toLowerCase ( ) } } ) ;
25+ const doc = await collection . findOne ( { url : { $eq : repoUrl . toLowerCase ( ) } } ) ;
2626 return doc ? toClass ( doc , Repo . prototype ) : null ;
2727} ;
2828
2929export const getRepoById = async ( _id : string ) : Promise < Repo | null > => {
3030 const collection = await connect ( collectionName ) ;
31- const doc = collection . findOne ( { _id : new ObjectId ( _id ) } ) ;
31+ const doc = await collection . findOne ( { _id : new ObjectId ( _id ) } ) ;
3232 return doc ? toClass ( doc , Repo . prototype ) : null ;
3333} ;
3434
Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ const collectionName = 'users';
77
88export const findUser = async function ( username : string ) : Promise < User | null > {
99 const collection = await connect ( collectionName ) ;
10- const doc = collection . findOne ( { username : { $eq : username . toLowerCase ( ) } } ) ;
10+ const doc = await collection . findOne ( { username : { $eq : username . toLowerCase ( ) } } ) ;
1111 return doc ? toClass ( doc , User . prototype ) : null ;
1212} ;
1313
1414export const findUserByEmail = async function ( email : string ) : Promise < User | null > {
1515 const collection = await connect ( collectionName ) ;
16- const doc = collection . findOne ( { email : { $eq : email . toLowerCase ( ) } } ) ;
16+ const doc = await collection . findOne ( { email : { $eq : email . toLowerCase ( ) } } ) ;
1717 return doc ? toClass ( doc , User . prototype ) : null ;
1818} ;
1919
2020export const findUserByOIDC = async function ( oidcId : string ) : Promise < User | null > {
2121 const collection = await connect ( collectionName ) ;
22- const doc = collection . findOne ( { oidcId : { $eq : oidcId } } ) ;
22+ const doc = await collection . findOne ( { oidcId : { $eq : oidcId } } ) ;
2323 return doc ? toClass ( doc , User . prototype ) : null ;
2424} ;
2525
You can’t perform that action at this time.
0 commit comments