Checked options.include when filtering tags (#10163)

no-issue
This commit is contained in:
Fabien O'Carroll 2018-11-14 17:54:15 +07:00 committed by GitHub
parent b2201d4179
commit 95ba6a55ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,8 +21,10 @@ const forPost = (attrs, frame) => {
}
if (labs.isSet('members')) {
// CASE: Members always adds tags, remove if the user didn't originally ask for them
const origQuery = frame.original.query || {};
if (!origQuery.include || !origQuery.include.includes('tags')) {
const origQueryOrOptions = frame.original.query || frame.original.options || {};
const origInclude = origQueryOrOptions.include;
if (!origInclude || !origInclude.includes('tags')) {
delete attrs.tags;
}
}