Merge pull request #12948 from nocodb/nc-fix/context-is-api-token

set is_api_token to context correctly also fix the typescript definit…
This commit is contained in:
Mert E.
2026-01-31 10:51:10 +03:00
committed by GitHub
3 changed files with 12 additions and 1 deletions

View File

@@ -19,6 +19,10 @@ export interface NcContext {
suppressDependencyEvaluation?: boolean;
additionalContext?: Record<string, any>;
schema_locked?: boolean;
cache?: boolean;
cacheMap?: any;
permissions?: any;
is_api_token?: boolean;
}
export interface NcRequest extends Partial<Request> {

View File

@@ -1113,6 +1113,10 @@ export class AclMiddleware implements NestInterceptor {
NcError.sourceDataReadOnly(source.alias);
}
}
if (req.context) {
req.context.is_api_token = req.user.is_api_token;
}
}
async intercept(

View File

@@ -268,7 +268,10 @@ async function createDemoTable({
break;
}
await api.dbTableRow.bulkCreate('noco', context.base.id, table.id, rowAttributes);
const BATCH_SIZE = 100;
for (let i = 0; i < rowAttributes.length; i += BATCH_SIZE) {
await api.dbTableRow.bulkCreate('noco', context.base.id, table.id, rowAttributes.slice(i, i + BATCH_SIZE));
}
return table;
}