While implementing an Airtable based backend, I discovered that overriding the HTTP method (in this case to PATCH to do an upsert) is not working as it should, even though the documentation explicitly mentions this example:
.
To test, use config: requestOptions: { method: 'PATCH' }. Before this fix, any saveMissing or updateMissing calls would still have method: POST.
I believe the issue is an incorrect use of defaults(), where the default values are put first in the parameter list, while it appears the function expects them to be the last (although, it is an unclear signature).
While implementing an Airtable based backend, I discovered that overriding the HTTP method (in this case to
PATCH
to do an upsert) is not working as it should, even though the documentation explicitly mentions this example:.
To test, use config:
requestOptions: { method: 'PATCH' }
. Before this fix, anysaveMissing
orupdateMissing
calls would still have method: POST.I believe the issue is an incorrect use of
defaults()
, where the default values are put first in the parameter list, while it appears the function expects them to be the last (although, it is an unclear signature).