mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 02:12:24 -05:00 
			
		
		
		
	[frontend] Custom Emoji Deletion (#994)
* re-add eslint * fix oauth url getting too long * actually attach single emoji get and delete routes * basic emoji details + deletion using rtk query * refactor emoji upload to rtk query * clean up old redux api+reducers for custom emoji * fix validation order * refactor custom emoji form fields * remove unused requires * cleanup, fix most eslint errors * more small eslint fixes * fix max emoji size * tiny bit of function documentation
This commit is contained in:
		
					parent
					
						
							
								be011b1641
							
						
					
				
			
			
				commit
				
					
						eb25739c34
					
				
			
		
					 32 changed files with 1467 additions and 506 deletions
				
			
		|  | @ -160,33 +160,6 @@ module.exports = function ({ apiCall, getChanges }) { | |||
| 				}); | ||||
| 			}; | ||||
| 		}, | ||||
| 
 | ||||
| 		fetchCustomEmoji: function fetchCustomEmoji() { | ||||
| 			return function (dispatch, _getState) { | ||||
| 				return Promise.try(() => { | ||||
| 					return dispatch(apiCall("GET", "/api/v1/admin/custom_emojis?filter=domain:local&limit=0")); | ||||
| 				}).then((emoji) => { | ||||
| 					return dispatch(admin.setEmoji(emoji)); | ||||
| 				}); | ||||
| 			}; | ||||
| 		}, | ||||
| 
 | ||||
| 		newEmoji: function newEmoji() { | ||||
| 			return function (dispatch, getState) { | ||||
| 				return Promise.try(() => { | ||||
| 					const state = getState().admin.newEmoji; | ||||
| 
 | ||||
| 					const update = getChanges(state, { | ||||
| 						formKeys: ["shortcode"], | ||||
| 						fileKeys: ["image"] | ||||
| 					}); | ||||
| 
 | ||||
| 					return dispatch(apiCall("POST", "/api/v1/admin/custom_emojis", update, "form")); | ||||
| 				}).then((emoji) => { | ||||
| 					return dispatch(admin.addEmoji(emoji)); | ||||
| 				}); | ||||
| 			}; | ||||
| 		} | ||||
| 	}; | ||||
| 	return adminAPI; | ||||
| }; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue