A
Alokai•2y ago
Tobi

[Shopware PWA] apiInstance.invoke.patch return's 500 error

Hey together, i have an Issue with the invoke.patch function: which is returning me
Uncaught (in promise)
{messages: Array(0), statusCode: 500}
messages
:
Array(0)
length
:
0
[[Prototype]]
:
Array(0)
statusCode
:
500
[[Prototype]]
:
Object
Uncaught (in promise)
{messages: Array(0), statusCode: 500}
messages
:
Array(0)
length
:
0
[[Prototype]]
:
Array(0)
statusCode
:
500
[[Prototype]]
:
Object
And no Request is outgoing. Someone have same issues currently?
2 Replies
skirianov
skirianov•2y ago
🤔 can you provide some more context?
Tobi
TobiOP•2y ago
Sure
const {apiInstance} = getApplicationContext({
contextName: "CustomizeProductDetail",
});


const updateCustomerProduct = async (field) => {

await apiInstance.invoke.patch({
address: "/some/patch/endpoint",
payload: {
some: "payload",
},
})

this[field] = this.toUpdate[field];

}
const {apiInstance} = getApplicationContext({
contextName: "CustomizeProductDetail",
});


const updateCustomerProduct = async (field) => {

await apiInstance.invoke.patch({
address: "/some/patch/endpoint",
payload: {
some: "payload",
},
})

this[field] = this.toUpdate[field];

}
This is the Code of all - Normaly this should do an patch request, but i only get the Uncaught (in promise) Okay, found the issue, the apiInstance.invoke.patch should based on the basic invoke functions, its needed to use them as Axios self so invoke.patch('url', {data})
Want results from more Discord servers?
Add your server