Hello,
I have encountered a significant problem related to my current use case, specifically when attempting to create input fields for the body of a REST API
request.
In my workflow, I rely on a PDF generator API to generate invoices based on data retrieved from a database table containing customer information such as names, addresses, and other relevant details. The challenge arises when I attempt to create a JSON
array of objects within JetAdmin. Despite my efforts, I consistently encounter error messages in the browser console, and the input fields I create are not saved when I save the HTTP form.
The error message I receive is as follows:
[Error] SyntaxError: Unexpected token ‘[’. Expected an identifier as property name.
It seems that there might be a syntax issue or compatibility problem with the chosen input type. I have tried various approaches to resolve the issue, but to no success yet.
Does someone recognize the errors?
This is my json body code:
“payload”: {
“patid”: params.id,
“geschlecht”: params.geschlecht,
“vorname”: params.vorname,
“nachname”: params.nachname,
“strasse”: params.strasse,
“hausnummer”: params.hausnummer,
“plz”: params.plz,
“ort”: params.ort,
“items” [
{
“leistungsdatum”: params.leistungsdatum,
“ziffer”: params.ziffer,
“leistung”: params.leistung,
“faktor”: params.faktor,
“punkte”: params.punkte,
}
],
},
“meta”: {
“_filename”: params.dateiname
}
}
}
I would greatly appreciate some assistance in resolving this problem. It is crucial for my project that I can successfully create input fields for the JSON
array of objects without encountering syntax errors or losing the input field upon saving.
Does someone have any insights, suggestions, or instructions to offer? It would be immensely helpful.
Best regards