Feature: Business logo API for web widget (#674)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ class ContactMergeAction
|
||||
def validate_contacts
|
||||
return if belongs_to_account?(@base_contact) && belongs_to_account?(@mergee_contact)
|
||||
|
||||
raise Exception, 'contact does not belong to the account'
|
||||
raise StandardError, 'contact does not belong to the account'
|
||||
end
|
||||
|
||||
def belongs_to_account?(contact)
|
||||
|
||||
@@ -8,7 +8,7 @@ class Api::BaseController < ApplicationController
|
||||
private
|
||||
|
||||
def authenticate_by_access_token?
|
||||
request.headers[:api_access_token].present?
|
||||
request.headers[:api_access_token].present? || request.headers[:HTTP_API_ACCESS_TOKEN].present?
|
||||
end
|
||||
|
||||
def set_conversation
|
||||
|
||||
@@ -26,6 +26,6 @@ class Api::V1::Accounts::InboxesController < Api::BaseController
|
||||
end
|
||||
|
||||
def inbox_update_params
|
||||
params.require(:inbox).permit(:enable_auto_assignment)
|
||||
params.require(:inbox).permit(:enable_auto_assignment, :avatar)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,8 @@ module AccessTokenAuthHelper
|
||||
}.freeze
|
||||
|
||||
def authenticate_access_token!
|
||||
access_token = AccessToken.find_by(token: request.headers[:api_access_token])
|
||||
token = request.headers[:api_access_token] || request.headers[:HTTP_API_ACCESS_TOKEN]
|
||||
access_token = AccessToken.find_by(token: token)
|
||||
render_unauthorized('Invalid Access Token') && return unless access_token
|
||||
|
||||
token_owner = access_token.owner
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Table name: accounts
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# locale :integer default("eng")
|
||||
# locale :integer default("en")
|
||||
# name :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
class Inbox < ApplicationRecord
|
||||
include Reportable
|
||||
include Avatarable
|
||||
|
||||
validates :account_id, presence: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user