mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 14:22:25 -05:00 
			
		
		
		
	[feature] Store admin actions in the db, prevent conflicting actions (#2167)
This commit is contained in:
		
					parent
					
						
							
								4f3daeebcb
							
						
					
				
			
			
				commit
				
					
						3ed1ca68e5
					
				
			
		
					 23 changed files with 1393 additions and 272 deletions
				
			
		|  | @ -79,6 +79,11 @@ import ( | |||
| //			description: not found | ||||
| //		'406': | ||||
| //			description: not acceptable | ||||
| //		'409': | ||||
| //			description: >- | ||||
| //				Conflict: There is already an admin action running that conflicts with this action. | ||||
| //				Check the error message in the response body for more information. This is a temporary | ||||
| //				error; it should be possible to process this action if you try again in a bit. | ||||
| //		'500': | ||||
| //			description: internal server error | ||||
| func (m *Module) AccountActionPOSTHandler(c *gin.Context) { | ||||
|  | @ -94,7 +99,7 @@ func (m *Module) AccountActionPOSTHandler(c *gin.Context) { | |||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	form := &apimodel.AdminAccountActionRequest{} | ||||
| 	form := &apimodel.AdminActionRequest{} | ||||
| 	if err := c.ShouldBind(form); err != nil { | ||||
| 		apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1) | ||||
| 		return | ||||
|  | @ -112,9 +117,9 @@ func (m *Module) AccountActionPOSTHandler(c *gin.Context) { | |||
| 		apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1) | ||||
| 		return | ||||
| 	} | ||||
| 	form.TargetAccountID = targetAcctID | ||||
| 	form.TargetID = targetAcctID | ||||
| 
 | ||||
| 	if errWithCode := m.processor.Admin().AccountAction(c.Request.Context(), authed.Account, form); errWithCode != nil { | ||||
| 	if _, errWithCode := m.processor.Admin().AccountAction(c.Request.Context(), authed.Account, form); errWithCode != nil { | ||||
| 		apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) | ||||
| 		return | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue