Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Eslint: indent fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
artkravchenko committed Jul 29, 2016
1 parent 6c0d847 commit 46578b4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
60 changes: 30 additions & 30 deletions src/api/controller.js
Expand Up @@ -178,10 +178,10 @@ export default class ApiController {
.collection()
.query(qb => {
qb
.join('geotags_posts', 'posts.id', 'geotags_posts.post_id')
.join('geotags', 'geotags_posts.geotag_id', 'geotags.id')
.orderBy('posts.created_at', 'desc')
.distinct();
.join('geotags_posts', 'posts.id', 'geotags_posts.post_id')
.join('geotags', 'geotags_posts.geotag_id', 'geotags.id')
.orderBy('posts.created_at', 'desc')
.distinct();

switch (geotag.attributes.type) {
case 'Planet':
Expand Down Expand Up @@ -321,20 +321,20 @@ export default class ApiController {
.map(row => row.post_id);

const q = Post.forge()
.query(qb => {
qb
.select()
.from('posts')
.whereIn('id', likes)
.union(function () {
this
.select()
.from('posts')
.whereIn('type', ['hashtag_like', 'school_like', 'geotag_like'])
.andWhere('user_id', userId);
})
.orderBy('updated_at', 'desc');
});
.query(qb => {
qb
.select()
.from('posts')
.whereIn('id', likes)
.union(function () {
this
.select()
.from('posts')
.whereIn('type', ['hashtag_like', 'school_like', 'geotag_like'])
.andWhere('user_id', userId);
})
.orderBy('updated_at', 'desc');
});

let posts = await q.fetchAll({ require: false, withRelated: POST_RELATIONS });
const post_comments_count = await this.countComments(posts);
Expand Down Expand Up @@ -388,11 +388,11 @@ export default class ApiController {
.map(row => row.post_id);

const q = Post.forge()
.query(qb => {
qb
.whereIn('id', favourites)
.orderBy('posts.updated_at', 'desc');
});
.query(qb => {
qb
.whereIn('id', favourites)
.orderBy('posts.updated_at', 'desc');
});

let posts = await q.fetchAll({ require: false, withRelated: POST_RELATIONS });
const post_comments_count = await this.countComments(posts);
Expand Down Expand Up @@ -2922,13 +2922,13 @@ export default class ApiController {
}
const Comment = this.bookshelf.model('Comment');
const q = Comment.forge()
.query(qb => {
qb
.select('post_id')
.count('id as comment_count')
.where('post_id', 'IN', ids)
.groupBy('post_id');
});
.query(qb => {
qb
.select('post_id')
.count('id as comment_count')
.where('post_id', 'IN', ids)
.groupBy('post_id');
});

const raw_counts = await q.fetchAll();

Expand Down
12 changes: 6 additions & 6 deletions src/utils/urlGenerator.js
Expand Up @@ -20,16 +20,16 @@ import { API_URL, URL, API_URL_NAMES, URL_NAMES } from '../config.js';

function getUrl(id, params) {
return urlAssembler()
.template(URL[id])
.param(params)
.toString();
.template(URL[id])
.param(params)
.toString();
}

function getApiUrl(id, params = {}) {
return urlAssembler()
.template(API_URL[id])
.param(params)
.toString();
.template(API_URL[id])
.param(params)
.toString();
}

export {
Expand Down

0 comments on commit 46578b4

Please sign in to comment.