Browse Source

fix: multi-collaborator datatype support

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
sync
Raju Udava 3 years ago
parent
commit
ba4e712567
  1. 10
      packages/nocodb/tests/sync/sync.js

10
packages/nocodb/tests/sync/sync.js

@ -71,6 +71,7 @@ let aTblNcTypeMap = {
multiSelect: UITypes.MultiSelect, multiSelect: UITypes.MultiSelect,
select: UITypes.SingleSelect, select: UITypes.SingleSelect,
collaborator: UITypes.Collaborator, collaborator: UITypes.Collaborator,
multiCollaborator: UITypes.Collaborator,
date: UITypes.Date, date: UITypes.Date,
// kludge: phone: UITypes.PhoneNumber, // kludge: phone: UITypes.PhoneNumber,
phone: UITypes.SingleLineText, phone: UITypes.SingleLineText,
@ -807,7 +808,14 @@ function nocoBaseDataProcessing(sDB, table, record) {
if (dt === UITypes.Rollup) delete rec[key]; if (dt === UITypes.Rollup) delete rec[key];
if (dt === UITypes.Collaborator) { if (dt === UITypes.Collaborator) {
rec[key] = `${value?.name} <${value?.email}>`; // in case of multi-collaborator, this will be an array
if(Array.isArray(value)) {
let collaborators = ""
for(let i=0; i<value.length; i++) {
collaborators += `${value[i]?.name} <${value[i]?.email}>, `
rec[key] = collaborators
}
} else rec[key] = `${value?.name} <${value?.email}>`;
} }
if (dt === UITypes.Barcode) rec[key] = value.text; if (dt === UITypes.Barcode) rec[key] = value.text;

Loading…
Cancel
Save