I have a frontend running on React and using Frappe REST APIs.
Requirements:
- Basically, I need to link two models, One is Client and the other one is Client Address. A client can only have one client address associated and the same vice versa.
- When I fetch a client doc, the response should be
{
"data": {
"name": "...",
"address": {
"line_1": "...",
"line_2": "...",
"zip": "..."
},
...
}
}
instead of (this is what I’m getting now when I use Link field type)
{
"data": {
"name": "...",
"address": "1ef2a7c80e",
...
}
}
Here are the client doctype fields:
That’s it.
As I could not find the solution in the documentation, please guide me if I’m doing something wrong. I’m new to Frappe.