You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: users_controller.rb
    path of file: ./repos/zammad/app/controllers
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

class UsersController < ApplicationController
  include ChecksUserAttributesByCurrentUserPermission
  include CanPaginate

  prepend_before_action -> { authorize! }, only: %i[import_example import_start search history unlock]
  prepend_be
    
  def avatar_destroy
    # get & validate image
    raise Exceptions::UnprocessableEntity, __("The required parameter 'id' is missing.") if !params[:id]

    # remove avatar
    Avatar.remove_one('User', current_user.id, params[:id])

    # update user link
    avatar = Avatar.get_default('User', current_user.id)
    user = User.find(current_user.id)
    user.update!(image: avatar.store_hash)

    render json: {}, status: :ok
  end