API: support PUT /maintenance/user/dmail_filter.json.

This commit is contained in:
evazion
2016-11-12 00:01:41 -06:00
parent a16b91e2bf
commit b0a0a32173

View File

@@ -3,6 +3,7 @@ module Maintenance
class DmailFiltersController < ApplicationController
before_filter :ensure_ownership
before_filter :member_only
respond_to :html, :json, :xml
def edit
@dmail_filter = CurrentUser.dmail_filter || DmailFilter.new
@@ -12,7 +13,7 @@ module Maintenance
@dmail_filter = CurrentUser.dmail_filter || DmailFilter.new
@dmail_filter.update(params.require(:dmail_filter).permit(:words), :as => CurrentUser.role)
flash[:notice] = "Filter updated"
redirect_to(dmail_path(@dmail.id))
respond_with(@dmail)
end
private