diff --git a/app/api/mobile/entities/project_package.rb b/app/api/mobile/entities/project_package.rb index 41d582c7..684913e7 100644 --- a/app/api/mobile/entities/project_package.rb +++ b/app/api/mobile/entities/project_package.rb @@ -20,6 +20,9 @@ module Mobile expose :contact_name, if: ->(package, opts){ opts[:user].id == package.creator_id || opts[:user].admin? || opts[:user].business? } expose :contact_phone, if: ->(package, opts){ opts[:user].id == package.creator_id || opts[:user].admin? || opts[:user].business? } + expose :updated_at do |package, _| + package.updated_at.try(:utc).try(:iso8601) + end expose :deadline_at do |package, _| package.deadline_at.try(:utc).try(:iso8601) end diff --git a/app/services/project_packages/save_service.rb b/app/services/project_packages/save_service.rb index cc58ec7d..d6abbca9 100644 --- a/app/services/project_packages/save_service.rb +++ b/app/services/project_packages/save_service.rb @@ -42,7 +42,8 @@ class ProjectPackages::SaveService private def need_check_code? - (package.new_record? && params[:contact_phone] != package.creator.phone) || package.contact_phone != params[:contact_phone] + (package.new_record? && params[:contact_phone] != package.creator.phone) || + (!package.new_record? && package.contact_phone != params[:contact_phone]) end def check_code_valid!