fix: Usa solo snakecase con le relations

This commit is contained in:
Maicol Battistini 2022-02-08 17:17:51 +01:00
parent 10094dbe26
commit 65284ceeae
No known key found for this signature in database
GPG Key ID: 4FDB0F87CDB1D34A
1 changed files with 5 additions and 2 deletions

View File

@ -12,7 +12,10 @@ import {
ToManyRelation,
ToOneRelation
} from 'coloquent';
import {capitalize} from 'lodash-es';
import {
capitalize,
snakeCase
} from 'lodash-es';
import type {
Children,
Vnode,
@ -430,7 +433,7 @@ export class RecordsPage extends Page {
}
for (const [relation, relatedModel] of Object.entries(relations)) {
model.setRelation(relation, relatedModel);
model.setRelation(snakeCase(relation), relatedModel);
}
const response = await model.save();