Fix report category not being saved in REST API (#17682)
This commit is contained in:
		
					parent
					
						
							
								462a6f7d72
							
						
					
				
			
			
				commit
				
					
						02b8d63fce
					
				
			
		
					 4 changed files with 62 additions and 26 deletions
				
			
		|  | @ -10,9 +10,7 @@ class Api::V1::ReportsController < Api::BaseController | |||
|     @report = ReportService.new.call( | ||||
|       current_account, | ||||
|       reported_account, | ||||
|       status_ids: reported_status_ids, | ||||
|       comment: report_params[:comment], | ||||
|       forward: report_params[:forward] | ||||
|       report_params | ||||
|     ) | ||||
| 
 | ||||
|     render json: @report, serializer: REST::ReportSerializer | ||||
|  | @ -20,14 +18,6 @@ class Api::V1::ReportsController < Api::BaseController | |||
| 
 | ||||
|   private | ||||
| 
 | ||||
|   def reported_status_ids | ||||
|     reported_account.statuses.with_discarded.find(status_ids).pluck(:id) | ||||
|   end | ||||
| 
 | ||||
|   def status_ids | ||||
|     Array(report_params[:status_ids]) | ||||
|   end | ||||
| 
 | ||||
|   def reported_account | ||||
|     Account.find(report_params[:account_id]) | ||||
|   end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue