mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 10:42:24 -05:00 
			
		
		
		
	[feature] Allow deleting avatar + header via settings panel (#3970)
This commit is contained in:
		
					parent
					
						
							
								b184432331
							
						
					
				
			
			
				commit
				
					
						650be1e8d0
					
				
			
		
					 3 changed files with 70 additions and 11 deletions
				
			
		|  | @ -26,10 +26,11 @@ import type { | |||
| import type { Theme } from "../../types/theme"; | ||||
| import { User } from "../../types/user"; | ||||
| import { DefaultInteractionPolicies, UpdateDefaultInteractionPolicies } from "../../types/interaction"; | ||||
| import { Account } from "../../types/account"; | ||||
| 
 | ||||
| const extended = gtsApi.injectEndpoints({ | ||||
| 	endpoints: (build) => ({ | ||||
| 		updateCredentials: build.mutation({ | ||||
| 		updateCredentials: build.mutation<Account, any>({ | ||||
| 			query: (formData) => ({ | ||||
| 				method: "PATCH", | ||||
| 				url: `/api/v1/accounts/update_credentials`, | ||||
|  | @ -39,6 +40,22 @@ const extended = gtsApi.injectEndpoints({ | |||
| 			}), | ||||
| 			...replaceCacheOnMutation("verifyCredentials") | ||||
| 		}), | ||||
| 
 | ||||
| 		deleteHeader: build.mutation<Account, void>({ | ||||
| 			query: (_) => ({ | ||||
| 				method: "DELETE", | ||||
| 				url: `/api/v1/profile/header`, | ||||
| 			}), | ||||
| 			...replaceCacheOnMutation("verifyCredentials") | ||||
| 		}), | ||||
| 
 | ||||
| 		deleteAvatar: build.mutation<Account, void>({ | ||||
| 			query: (_) => ({ | ||||
| 				method: "DELETE", | ||||
| 				url: `/api/v1/profile/avatar`, | ||||
| 			}), | ||||
| 			...replaceCacheOnMutation("verifyCredentials") | ||||
| 		}), | ||||
| 		 | ||||
| 		user: build.query<User, void>({ | ||||
| 			query: () => ({url: `/api/v1/user`}) | ||||
|  | @ -122,6 +139,8 @@ const extended = gtsApi.injectEndpoints({ | |||
| 
 | ||||
| export const { | ||||
| 	useUpdateCredentialsMutation, | ||||
| 	useDeleteHeaderMutation, | ||||
| 	useDeleteAvatarMutation, | ||||
| 	useUserQuery, | ||||
| 	usePasswordChangeMutation, | ||||
| 	useEmailChangeMutation, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue