fix: Unknown Slack users should be able to search team accessible docs (#1049)

* fix: Unknown Slack users should be able to search team accessible docs

* test: fix flaky test

* test: remove obsolete snapshot

* lint

* flow

* fix: Spelling mistake
This commit is contained in:
Tom Moor
2019-09-22 11:52:15 -07:00
committed by GitHub
parent d46530a4a0
commit b1a1d24f9c
6 changed files with 179 additions and 111 deletions

View File

@ -190,6 +190,15 @@ Team.prototype.activateUser = async function(user: User, admin: User) {
});
};
Team.prototype.collectionIds = async function(paranoid: boolean = true) {
let models = await Collection.findAll({
attributes: ['id', 'private'],
where: { teamId: this.id, private: false },
paranoid,
});
return models.map(c => c.id);
};
Team.beforeSave(uploadAvatar);
export default Team;