Skip to content

Commit 788de82

Browse files
committed
chore(): clean up
1 parent 17c654a commit 788de82

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/models/eventsFactory.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,13 @@ class EventsFactory extends Factory {
290290
);
291291

292292
const cursor = this.getCollection(this.TYPES.DAILY_EVENTS).aggregate(pipeline);
293-
294293
const result = await cursor.toArray();
295294

296-
const nextCursor = result.pop()._id;
295+
let nextCursor;
296+
297+
if (result.length === limit + 1) {
298+
nextCursor = result.pop()._id;
299+
}
297300

298301
const composedResult = result.map(dailyEvent => {
299302
const repetition = dailyEvent.repetition;
@@ -687,8 +690,6 @@ class EventsFactory extends Factory {
687690
_id: new ObjectID(eventId),
688691
});
689692

690-
console.log('repetition found', repetition);
691-
692693
/**
693694
* If repetition is not found by eventId, try to find it by eventId
694695
*/
@@ -697,15 +698,11 @@ class EventsFactory extends Factory {
697698
.findOne({
698699
_id: new ObjectID(eventId),
699700
});
700-
701-
console.log('no repetition found, fetched by original event id', originalEvent);
702701
} else {
703702
originalEvent = await this.getCollection(this.TYPES.EVENTS)
704703
.findOne({
705704
groupHash: repetition.groupHash,
706705
});
707-
708-
console.log('repetition found, fetched by groupHash', originalEvent);
709706
}
710707

711708
return originalEvent;

src/models/projectsFactory.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ export default class ProjectsFactory extends AbstractModelFactory<ProjectDBSchem
3535
* @param id - user id
3636
*/
3737
public async findById(id: string): Promise<ProjectModel | null> {
38-
console.log('id in data loader', id);
39-
4038
const projectData = await this.dataLoaders.projectById.load(id);
4139

4240
if (!projectData) {

src/resolvers/event.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ module.exports = {
4444
* @return {Promise<UserModel[]> | null}
4545
*/
4646
async visitedBy({ visitedBy, projectId }, _args, { factories, user }) {
47-
console.log('visitedBy, projectId', visitedBy, projectId);
48-
4947
/**
5048
* Crutch for Demo Workspace
5149
*/

0 commit comments

Comments
 (0)