Skip to content

Conversation

@radg1596
Copy link

@radg1596 radg1596 commented Dec 19, 2022

Summary

  • [NJ][Feature][IOS] Solved a execution error when try to access to a Firestore document data:

Traceback (most recent call last):
File "", line 17, in
File "/lib/ufirestore/ufirestore.py", line 229, in get
File "/lib/ufirestore/ufirestore.py", line 104, in get
File "/lib/ufirestore/ufirestore.py", line 52, in send_request
TypeError: unexpected keyword argument 'params'

Issue: #1


response = urequests.request(method, path, data=params, json=data, headers=headers)
if method == "POST":
response = urequests.request(method, path, data=None, json=data)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should include the headers, no?

headers["Authorization"] = "Bearer " + FIREBASE_GLOBAL_VAR.ACCESS_TOKEN

response = urequests.request(method, path, data=params, json=data, headers=headers)
if method == "POST":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting that the patch function should be a "PATCH" method to work properly (this may be a new thing, this is such an old pull request that it may predate it)

LOCAL_OUTPUT = send_request(PATH+LOCAL_PARAMS, "post", data=DATA)
LOCAL_PARAMS += "updateMask=" + field
DATA = DOC.process()
LOCAL_OUTPUT = send_request(PATH, "POST", data=DATA)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here one would need to use a PATCH method and the updateMask.fieldPaths notation is correct in the original, it just needs proper ampersand joining as the to_url_params function supports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants