Skip to content

Commit

Permalink
Merge pull request #66 from AngelLozan/bugfix
Browse files Browse the repository at this point in the history
Order update and removes unnecessary code
  • Loading branch information
AngelLozan authored Dec 14, 2024
2 parents c407c31 + 1af8304 commit ff66723
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ gem 'json'
gem 'uri'
gem 'net-http'
gem 'nokogiri', '~> 1.12', '>= 1.12.4'
gem 'rubocop', require: false
gem 'ruby-lsp'
gem 'ruby-lsp-rails'
# gem 'capistrano', '~> 3.11'
# gem 'capistrano-rails', '~> 1.4'
# gem 'capistrano-passenger', '~> 0.2.0'
Expand Down
37 changes: 37 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ GEM
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ansi (1.5.0)
ast (2.4.2)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
aws_cf_signer (0.1.3)
Expand Down Expand Up @@ -175,10 +176,12 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
launchy (2.5.2)
addressable (~> 2.8)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
logger (1.6.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -218,11 +221,16 @@ GEM
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pg (1.5.4)
pg_search (2.3.6)
activerecord (>= 5.2)
activesupport (>= 5.2)
popper_js (2.11.8)
prism (1.2.0)
psych (5.1.2)
stringio
public_suffix (5.0.4)
Expand Down Expand Up @@ -260,7 +268,10 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.1.0)
rbs (3.7.0)
logger
rdoc (6.6.2)
psych (>= 4.0.0)
recaptcha (5.16.0)
Expand All @@ -279,6 +290,25 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.6)
rubocop (1.69.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.36.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
ruby-lsp (0.22.1)
language_server-protocol (~> 3.17.0)
prism (>= 1.2, < 2.0)
rbs (>= 3, < 4)
sorbet-runtime (>= 0.5.10782)
ruby-lsp-rails (0.3.27)
ruby-lsp (>= 0.22.0, < 0.23.0)
ruby-progressbar (1.13.0)
ruby_audit (2.3.0)
bundler-audit (~> 0.9.0)
Expand All @@ -301,6 +331,7 @@ GEM
redis (>= 4.5.0, < 5)
sidekiq-failures (1.0.4)
sidekiq (>= 4.0.0)
sorbet-runtime (0.5.11694)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand All @@ -322,6 +353,9 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unaccent (0.4.0)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (0.13.0)
warden (1.2.9)
rack (>= 2.0.9)
Expand Down Expand Up @@ -379,6 +413,9 @@ DEPENDENCIES
rails (~> 7.0.6)
recaptcha
redis (~> 4.0)
rubocop
ruby-lsp
ruby-lsp-rails
ruby_audit
sassc-rails
selenium-webdriver
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,14 @@ def submit_printify_order
"is_printify_express": false,
"send_shipping_notification": false,
"address_to": {
"first_name": order_params[:name],
"last_name": order_params[:name],
"first_name": order_params[:name]&.split(" ")&.first || "No FirstName",
"last_name": order_params[:name]&.split(" ")&.last || "No LastName",
"email": order_params[:email],
"phone": order_params[:phone],
"country": order_params[:country],
"region": "",
"address1": order_params[:address],
"address2": "",
"address2": order_params[:state],
"city": order_params[:city],
"zip": order_params[:zip]
}
Expand All @@ -472,7 +472,7 @@ def submit_printify_order
request.body = JSON.dump(request_body)

response = http.request(request)
# raw_data = response.read_body

raw_data = JSON.parse(response.read_body)

Rails.logger.info ">>>>>>>>>>>>>>> RAW DATA SUBMIT_PRINTIFY: #{raw_data}<<<<<<<<<<<<<<<<<<<"
Expand Down
8 changes: 0 additions & 8 deletions app/controllers/prints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def show
# request.body = JSON.dump({}) # if you need to send a body with the request...

response = http.request(request)
# products = response.read_body
raw_data = JSON.parse(response.read_body)

print = raw_data
Expand Down Expand Up @@ -127,12 +126,6 @@ def unpublish_print
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["User-Agent"] = "RUBY"
# request.body = JSON.dump({
# external: {
# id: "#{id}",
# handle: "https://theartofjaleh.com/prints/show/#{id}"
# }
# })
request.body = JSON.dump({
reason: "I need to remove this print from my shop."
})
Expand Down Expand Up @@ -221,7 +214,6 @@ def load_products
# request.body = JSON.dump({}) # if you need to send a body with the request...

response = http.request(request)
# products = response.read_body
raw_data = JSON.parse(response.read_body)

products = raw_data["data"]
Expand Down
7 changes: 0 additions & 7 deletions app/javascript/controllers/hello_controller.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/javascript/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ application.register("crypto", CryptoController)
import FlashController from "./flash_controller"
application.register("flash", FlashController)

import HelloController from "./hello_controller"
application.register("hello", HelloController)

import NftsController from "./nfts_controller"
application.register("nfts", NftsController)

Expand Down

0 comments on commit ff66723

Please sign in to comment.