mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-12-24 13:27:51 +08:00
fix: omitted keys are ignored during merging (#501)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { get, isEmpty, isObject, uniq } from 'lodash'
|
||||
import { get, isEmpty, isObject, union, uniq } from 'lodash'
|
||||
import {
|
||||
CreateGroup,
|
||||
DeleteConnection,
|
||||
@@ -210,7 +210,8 @@ const useConnectionStore = defineStore('connections', {
|
||||
|
||||
mergeConnectionProfile(dest, src) {
|
||||
const mergeObj = (destObj, srcObj) => {
|
||||
for (const k in srcObj) {
|
||||
const keys = union(Object.keys(destObj), Object.keys(srcObj))
|
||||
for (const k of keys) {
|
||||
const t = typeof srcObj[k]
|
||||
if (t === 'string') {
|
||||
destObj[k] = srcObj[k] || destObj[k] || ''
|
||||
|
||||
Reference in New Issue
Block a user