mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
refactor: target key (#6000)
This commit is contained in:
parent
91a998fff8
commit
648e282d48
@ -171,10 +171,10 @@ export const TargetKey = observer(
|
||||
setOptions(
|
||||
getCollection(target)
|
||||
.fields?.filter((v) => {
|
||||
if (type !== 'hasMany') {
|
||||
return v.primaryKey || v.unique;
|
||||
if (v.primaryKey || v.unique) {
|
||||
return true;
|
||||
}
|
||||
return supportTypes.includes(v.type);
|
||||
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||
})
|
||||
.map((k) => {
|
||||
return {
|
||||
@ -196,10 +196,10 @@ export const TargetKey = observer(
|
||||
setOptions(
|
||||
getCollection(target)
|
||||
.fields?.filter((v) => {
|
||||
if (type !== 'hasMany') {
|
||||
return v.primaryKey || v.unique;
|
||||
if (v.primaryKey || v.unique) {
|
||||
return true;
|
||||
}
|
||||
return supportTypes.includes(v.type);
|
||||
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||
})
|
||||
.map((k) => {
|
||||
return {
|
||||
|
@ -161,10 +161,10 @@ export const TargetKey = observer(
|
||||
setOptions(
|
||||
getCollection(target, dataSourceKey)
|
||||
.fields?.filter((v) => {
|
||||
if (type !== 'hasMany') {
|
||||
return v.primaryKey || v.unique;
|
||||
if (v.primaryKey || v.unique) {
|
||||
return true;
|
||||
}
|
||||
return supportTypes.includes(v.type);
|
||||
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||
})
|
||||
.map((k) => {
|
||||
return {
|
||||
@ -196,10 +196,10 @@ export const TargetKey = observer(
|
||||
setOptions(
|
||||
data.data
|
||||
?.filter((v) => {
|
||||
if (type !== 'hasMany') {
|
||||
return v.primaryKey || v.unique;
|
||||
if (v.primaryKey || v.unique) {
|
||||
return true;
|
||||
}
|
||||
return supportTypes.includes(v.type);
|
||||
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||
})
|
||||
.map((k) => {
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user