mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 13:05:31 +08:00
Apply comments from eviltrout, using this.get('category.id'), and use snake case for category_id
This commit is contained in:
parent
439f393d89
commit
c6e54741bb
|
@ -85,8 +85,7 @@ var controllerOpts = {
|
|||
if (selected.length > 0) {
|
||||
promise = Discourse.Topic.bulkOperation(selected, operation);
|
||||
} else {
|
||||
var category = this.get('category');
|
||||
promise = Discourse.Topic.bulkOperationByFilter('unread', operation, category ? category.id : null);
|
||||
promise = Discourse.Topic.bulkOperationByFilter('unread', operation, this.get('category.id'));
|
||||
}
|
||||
promise.then(function(result) {
|
||||
if (result && result.topic_ids) {
|
||||
|
|
|
@ -454,7 +454,7 @@ Discourse.Topic.reopenClass({
|
|||
|
||||
bulkOperationByFilter: function(filter, operation, categoryId) {
|
||||
var data = { filter: filter, operation: operation };
|
||||
if (categoryId) data['categoryId'] = categoryId;
|
||||
if (categoryId) data['category_id'] = categoryId;
|
||||
return Discourse.ajax("/topics/bulk", {
|
||||
type: 'PUT',
|
||||
data: data
|
||||
|
|
|
@ -359,8 +359,8 @@ class TopicsController < ApplicationController
|
|||
topic_ids = params[:topic_ids].map {|t| t.to_i}
|
||||
elsif params[:filter] == 'unread'
|
||||
tq = TopicQuery.new(current_user)
|
||||
if params[:categoryId]
|
||||
topic_ids = TopicQuery.unread_filter(tq.joined_topic_user).listable_topics.where('category_id = ?', params[:categoryId]).pluck(:id)
|
||||
if params[:category_id]
|
||||
topic_ids = TopicQuery.unread_filter(tq.joined_topic_user).listable_topics.where('category_id = ?', params[:category_id]).pluck(:id)
|
||||
else
|
||||
topic_ids = TopicQuery.unread_filter(tq.joined_topic_user).listable_topics.pluck(:id)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user