feat: Ability to remove user profile picture (#3156)

Fixes #3107
This commit is contained in:
Santhosh C
2021-11-27 00:56:07 +05:30
committed by GitHub
parent add004a56e
commit b326da7d94
9 changed files with 84 additions and 3 deletions

View File

@@ -13,6 +13,11 @@ class Api::V1::ProfilesController < Api::BaseController
@user.update!(profile_params)
end
def avatar
@user.avatar.attachment.destroy! if @user.avatar.attached?
head :ok
end
def availability
@user.account_users.find_by!(account_id: availability_params[:account_id]).update!(availability: availability_params[:availability])
end