mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
WIP
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Model } from 'objection';
|
||||
import {transform, snakeCase} from 'lodash';
|
||||
import {mapKeysDeep} from '@/utils';
|
||||
|
||||
export default class ModelBase extends Model {
|
||||
static get collection() {
|
||||
@@ -13,4 +15,13 @@ export default class ModelBase extends Model {
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
$formatJson(json, opt) {
|
||||
const transformed = mapKeysDeep(json, (value, key) => {
|
||||
return snakeCase(key);
|
||||
});
|
||||
const parsedJson = super.$formatJson(transformed, opt);
|
||||
|
||||
return parsedJson;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user