Skip to content

Commit

Permalink
Survey RDB: fixed creation and modified date update
Browse files Browse the repository at this point in the history
  • Loading branch information
SteRiccio committed Nov 1, 2024
1 parent 1a6b23a commit b7d8a5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const insertNodesInBulk = async ({ user, surveyId, nodesArray, systemActi
const nodeValues = nodesArray.map((node) => [
Node.getUuid(node),
Node.getDateCreated(node),
Node.getDateCreated(node),
Node.getDateModified(node),
Node.getRecordUuid(node),
Node.getParentUuid(node),
Node.getNodeDefUuid(node),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as Record from '@core/record/record'
import * as Node from '@core/record/node'
import { Schemata, TableDataNodeDef } from '@common/model/db'
import { TableDataNodeDefColUtils } from '@common/model/db/tables/dataNodeDef/colUtils'
import * as SchemaRdb from '@common/surveyRdb/schemaRdb'
import * as NodeDefTable from '@common/surveyRdb/nodeDefTable'

import { RdbUpdateTypes, RdbUpdates } from './RdbUpdates'
Expand Down Expand Up @@ -48,6 +47,8 @@ const _getValuesByColumnName = ({ survey, record, nodeDef, node, ancestorMultipl
const result = {
[columnSet.uuid]: Node.getUuid(node),
[columnSet.parentUuid]: Node.getUuid(ancestorMultipleEntity),
[columnSet.dateCreated]: Node.getDateCreated(node),
[columnSet.dateModified]: Node.getDateModified(node),
}
if (NodeDef.isRoot(nodeDef)) {
Object.assign(result, {
Expand Down Expand Up @@ -93,7 +94,7 @@ export const generateRdbUpdates = ({ survey, record, nodes }) => {
const ancestorMultipleEntity = _findAncestor({ ancestorDefUuid, node, nodes })
const update = {
type,
schema: SchemaRdb.getName(Survey.getId(survey)),
schema: Schemata.getSchemaSurveyRdb(Survey.getId(survey)),
table: NodeDefTable.getTableName(nodeDef, ancestorDef),
nodeDefUuid: NodeDef.getUuid(nodeDef),
nodeDefHierarchyLevel: NodeDef.getMetaHierarchy(nodeDef).length,
Expand Down

0 comments on commit b7d8a5f

Please sign in to comment.