Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit a9bd085

Browse files
authored
Merge pull request #5488 from withspectrum/fix-delete-community-watercooler
When deleting a community, also delete its watercooler
2 parents d0e767f + 4e8b315 commit a9bd085

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

api/models/thread.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,7 @@ export const getThreadsByCommunity = (communityId: string): Promise<Array<DBThre
107107
rightBound: 'open',
108108
})
109109
.orderBy({ index: db.desc('communityIdAndLastActive') })
110-
.filter(thread => db.not(thread.hasFields('deletedAt')).and(NOT_WATERCOOLER(thread)))
111-
.run();
112-
};
113-
114-
// prettier-ignore
115-
export const getThreadsByCommunityInTimeframe = (communityId: string, range: Timeframe): Promise<Array<Object>> => {
116-
const { current } = parseRange(range);
117-
return db
118-
.table('threads')
119-
.getAll(communityId, { index: 'communityId' })
120-
.filter(db.row('createdAt').during(db.now().sub(current), db.now()))
121-
.filter(thread => db.not(thread.hasFields('deletedAt')).and(NOT_WATERCOOLER(thread)))
110+
.filter(thread => db.not(thread.hasFields('deletedAt')))
122111
.run();
123112
};
124113

0 commit comments

Comments
 (0)