feat: profile - pages

This commit is contained in:
NGPixel
2020-04-05 23:48:13 -04:00
committed by Nicolas Giard
parent 80ee45ae4f
commit d959ef7e5c
4 changed files with 115 additions and 3 deletions

View File

@@ -97,6 +97,18 @@ module.exports = {
if (args.locale) {
queryBuilder.where('localeCode', args.locale)
}
if (args.creatorId && args.authorId && args.creatorId > 0 && args.authorId > 0) {
queryBuilder.where(function () {
this.where('creatorId', args.creatorId).orWhere('authorId', args.authorId)
})
} else {
if (args.creatorId && args.creatorId > 0) {
queryBuilder.where('creatorId', args.creatorId)
}
if (args.authorId && args.authorId > 0) {
queryBuilder.where('authorId', args.authorId)
}
}
if (args.tags && args.tags.length > 0) {
queryBuilder.whereIn('tags.tag', args.tags)
}