mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-938: fixed bug on deletion final associated child record was not working properly
This commit is contained in:
@ -823,16 +823,19 @@ public class QJavalinImplementation
|
|||||||
JSONObject associationsJSON = new JSONObject(value);
|
JSONObject associationsJSON = new JSONObject(value);
|
||||||
for(String key : associationsJSON.keySet())
|
for(String key : associationsJSON.keySet())
|
||||||
{
|
{
|
||||||
JSONArray associatedRecords = associationsJSON.getJSONArray(key);
|
JSONArray associatedRecordsJSON = associationsJSON.getJSONArray(key);
|
||||||
for(int i = 0; i < associatedRecords.length(); i++)
|
List<QRecord> associatedRecords = new ArrayList<>();
|
||||||
|
record.withAssociatedRecords(key, associatedRecords);
|
||||||
|
|
||||||
|
for(int i = 0; i < associatedRecordsJSON.length(); i++)
|
||||||
{
|
{
|
||||||
QRecord associatedRecord = new QRecord();
|
QRecord associatedRecord = new QRecord();
|
||||||
JSONObject recordJSON = associatedRecords.getJSONObject(i);
|
JSONObject recordJSON = associatedRecordsJSON.getJSONObject(i);
|
||||||
for(String k : recordJSON.keySet())
|
for(String k : recordJSON.keySet())
|
||||||
{
|
{
|
||||||
associatedRecord.withValue(k, ValueUtils.getValueAsString(recordJSON.get(k)));
|
associatedRecord.withValue(k, ValueUtils.getValueAsString(recordJSON.get(k)));
|
||||||
}
|
}
|
||||||
record.withAssociatedRecord(key, associatedRecord);
|
associatedRecords.add(associatedRecord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user