Skip to content

Commit

Permalink
Merge pull request #1474 from gchq/bugfix/update-model-settings
Browse files Browse the repository at this point in the history
Reverted change to model merging during update
  • Loading branch information
ARADDCC012 authored Aug 28, 2024
2 parents c90e93a + 2d2d384 commit df339f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/services/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Validator } from 'jsonschema'
import _ from 'lodash'

import authentication from '../connectors/authentication/index.js'
import { ModelAction, ModelActionKeys } from '../connectors/authorisation/actions.js'
Expand Down Expand Up @@ -320,7 +321,7 @@ export async function updateModel(user: UserInterface, modelId: string, modelDif
throw Forbidden(auth.info, { userDn: user.dn })
}

Object.assign(model, modelDiff)
_.mergeWith(model, modelDiff, (a, b) => (_.isArray(b) ? b : undefined))
await model.save()

return model
Expand Down

0 comments on commit df339f9

Please sign in to comment.