Browse Source

fix: airtable import corrections

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/6318/head
Pranav C 1 year ago
parent
commit
d1e9c4261b
  1. 20
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

20
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -113,7 +113,7 @@ export class AtImportProcessor {
await sMapEM.init(); await sMapEM.init();
const userRole = syncDB.user.roles const userRole = syncDB.user.roles
.split(',') .split(',')
.reduce((rolesObj, role) => ({ [role]: true, ...rolesObj }), {}); .reduce((rolesObj, role) => ({ [role]: true, ...rolesObj }));
const sMap = { const sMap = {
// static mapping records between aTblId && ncId // static mapping records between aTblId && ncId
@ -666,7 +666,12 @@ export class AtImportProcessor {
const view = { list: [] }; const view = { list: [] };
view['list'] = await this.viewsService.viewList({ view['list'] = await this.viewsService.viewList({
tableId: table.id, tableId: table.id,
user: { roles: userRole }, user: {
roles: userRole,
project_roles: {
owner: true,
},
},
}); });
recordPerfStats(_perfStart, 'dbView.list'); recordPerfStats(_perfStart, 'dbView.list');
@ -829,7 +834,7 @@ export class AtImportProcessor {
const childTblSchema: any = const childTblSchema: any =
await this.tablesService.getTableWithAccessibleViews({ await this.tablesService.getTableWithAccessibleViews({
tableId: ncLinkMappingTable[x].nc.childId, tableId: ncLinkMappingTable[x].nc.childId,
user: { ...syncDB.user, project_roles: { owner: true } } user: { ...syncDB.user, project_roles: { owner: true } },
}); });
recordPerfStats(_perfStart, 'dbTable.read'); recordPerfStats(_perfStart, 'dbTable.read');
@ -1734,7 +1739,12 @@ export class AtImportProcessor {
const viewList = { list: [] }; const viewList = { list: [] };
viewList['list'] = await this.viewsService.viewList({ viewList['list'] = await this.viewsService.viewList({
tableId: tblId, tableId: tblId,
user: { roles: userRole }, user: {
roles: userRole,
project_roles: {
owner: true,
},
},
}); });
recordPerfStats(_perfStart, 'dbView.list'); recordPerfStats(_perfStart, 'dbView.list');
@ -2328,7 +2338,7 @@ export class AtImportProcessor {
ncTblList['list'] = await this.tablesService.getAccessibleTables({ ncTblList['list'] = await this.tablesService.getAccessibleTables({
projectId: ncCreatedProjectSchema.id, projectId: ncCreatedProjectSchema.id,
baseId: syncDB.baseId, baseId: syncDB.baseId,
roles: userRole, roles: { ...userRole, owner: true },
}); });
recordPerfStats(_perfStart, 'base.tableList'); recordPerfStats(_perfStart, 'base.tableList');

Loading…
Cancel
Save