add methos to api customer controller

This commit is contained in:
Zin Moe
2020-07-23 18:19:25 +06:30
parent d2504d8433
commit 682ff6bb23
3 changed files with 25 additions and 2 deletions

View File

@@ -20,10 +20,11 @@ class CustomerImageUploader < CarrierWave::Uploader::Base
end
def filename
return unless original_filename.present?
if Shop.current_shop.shop_code.nil?
"#{original_filename}" if original_filename.present?
"#{original_filename}"
else
"#{Shop.current_shop.shop_code}_#{original_filename}" if original_filename.present?
"#{Shop.current_shop.shop_code}_#{original_filename}"
end
end