File tree Expand file tree Collapse file tree 2 files changed +28
-14
lines changed
table/src/modules/records/services/methods Expand file tree Collapse file tree 2 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,17 @@ export async function createTablesRecordsMethod(
2121 if ( value . isNone ( ) ) {
2222 continue
2323 }
24- const spec = new ReferenceEqual ( value . unwrap ( ) as ReferenceFieldValue , field . id )
25- specs . push ( spec )
24+ const referecneValue = value . unwrap ( ) as ReferenceFieldValue
25+ if ( referecneValue . value ?. length ) {
26+ const spec = new ReferenceEqual ( value . unwrap ( ) as ReferenceFieldValue , field . id )
27+ specs . push ( spec )
28+ }
2629 }
2730
28- const spec = and ( ...specs ) as Option < RecordComositeSpecification >
29- await this . repo . updateOneById ( table , record , spec )
31+ if ( specs . length ) {
32+ const spec = and ( ...specs ) as Option < RecordComositeSpecification >
33+ await this . repo . updateOneById ( table , record , spec )
34+ }
3035 }
3136 }
3237}
Original file line number Diff line number Diff line change 5454 "id" : " company" ,
5555 "type" : " reference" ,
5656 "option" : {
57+ "createSymmetricField" : true ,
5758 "foreignTable" : {
5859 "tableName" : " Companies"
5960 }
6061 }
6162 },
63+ "Company Name" : {
64+ "id" : " companyName" ,
65+ "type" : " rollup" ,
66+ "option" : {
67+ "referenceFieldId" : " company" ,
68+ "rollupFieldId" : " name" ,
69+ "fn" : " lookup"
70+ }
71+ },
72+ "Company Industry" : {
73+ "id" : " companyIndustry" ,
74+ "type" : " rollup" ,
75+ "option" : {
76+ "referenceFieldId" : " company" ,
77+ "rollupFieldId" : " industry" ,
78+ "fn" : " lookup"
79+ }
80+ },
6281 "Deals" : {
6382 "id" : " deals" ,
6483 "type" : " reference" ,
10741093 "Website" : {
10751094 "id" : " website" ,
10761095 "type" : " url"
1077- },
1078- "Contacts" : {
1079- "id" : " contacts" ,
1080- "type" : " reference" ,
1081- "option" : {
1082- "foreignTable" : {
1083- "tableName" : " Contacts"
1084- },
1085- "createSymmetricField" : true
1086- }
10871096 }
10881097 },
10891098 "records" : [
You can’t perform that action at this time.
0 commit comments