Skip to content

Commit

Permalink
More Asset Library Prep
Browse files Browse the repository at this point in the history
  • Loading branch information
vnznznz committed Apr 28, 2023
1 parent fd582ad commit ac1215f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Codecks Logo (addons/codecks_user_reports/cdx__icon.svg) Copyright codecks.io
Codecks Logo (addons/codecks_user_reports/icons/) Copyright codecks.io
14 changes: 7 additions & 7 deletions addons/codecks_user_reports/CodecksUserReport.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@icon("res://addons/codecks_user_reports/cdx__icon.svg")
@icon("res://addons/codecks_user_reports/icons/cdx__icon.svg")
class_name CodecksUserReport extends Node

## Create Codecks User Reports
Expand Down Expand Up @@ -110,8 +110,8 @@ func _upload_file(upload_url:String, fields:Dictionary, file_name:String, file_p
# add file to request body
body.append_array(('Content-Disposition: form-data; name="file"; filename="%s"\r\n' % file_name).to_utf8_buffer())
body.append_array(endl)
var file = FileAccess.open(file_path, FileAccess.READ)

var file = FileAccess.open(file_path, FileAccess.READ)

if file == null:
push_error("failed to open %s for reading, error: " % [file_path, FileAccess.get_open_error()])
Expand All @@ -133,7 +133,7 @@ func _upload_file(upload_url:String, fields:Dictionary, file_name:String, file_p

# send request
var error = _upload_file_request.request_raw(
upload_url,
upload_url,
["Content-Type: multipart/form-data; boundary=%s" % boundary, "Content-Length: %s" % str(body.size())],
HTTPClient.METHOD_POST, body
)
Expand Down Expand Up @@ -181,11 +181,11 @@ func send():
if self.email != null and len(self.email) > 0 and self.email.count("@") >= 1:
body["userEmail"] = self.email

var json_body = JSON.stringify(body)
var json_body = JSON.stringify(body)
var error = _create_card_request.request(
"https://api.codecks.io/user-report/v1/create-report?token=%s" % self.report_token,
["Content-Type: application/json"],
HTTPClient.METHOD_POST,
["Content-Type: application/json"],
HTTPClient.METHOD_POST,
json_body
)
if error != OK:
Expand Down
24 changes: 24 additions & 0 deletions addons/codecks_user_reports/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MIT License

Copyright (c) 2022 Vinzenz Sinapius

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Codecks Logo (addons/codecks_user_reports/icons/) Copyright codecks.io
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ac1215f

Please sign in to comment.