initial commit
This commit is contained in:
1 parent
ef15e5d6e0
commit
6bc9194e8f
9 files changed
+92
-3
No files matched your search
@@ -6,4 +6,5 @@ export interface ITeamsRepository {
|
||||
// update
|
||||
// delete
|
||||
// other
|
||||
findAllTeamIds(): Promise<string[]>;
|
||||
}
|
||||
@@ -31,6 +31,11 @@ class MongoTeamsRepository implements ITeamsRepository {
|
||||
const team = await TeamModel.create({ email });
|
||||
return this.toEntity(team);
|
||||
};
|
||||
|
||||
findAllTeamIds = async (): Promise<string[]> => {
|
||||
const teams = await TeamModel.find({}, { _id: 1 }).lean();
|
||||
return teams.map((team) => this.toStringId(team._id));
|
||||
};
|
||||
}
|
||||
|
||||
export default MongoTeamsRepository;
|
||||
Reference in new issue
Block a user