Browse Source

refactor: exclude unnecessary data from response

pull/9506/head
Pranav C 2 months ago
parent
commit
8bbe8f5297
  1. 7
      packages/nocodb/src/controllers/sources.controller.ts
  2. 4
      packages/nocodb/src/services/sources.service.ts

7
packages/nocodb/src/controllers/sources.controller.ts

@ -37,6 +37,7 @@ export class SourcesController {
if (source.isMeta()) {
source.config = undefined;
}
source.integration_config = undefined;
return source;
}
@ -60,6 +61,9 @@ export class SourcesController {
req,
});
source.config = undefined;
source.integration_config = undefined;
return source;
}
@ -77,9 +81,8 @@ export class SourcesController {
});
for (const source of sources) {
if (source.isMeta()) {
source.config = undefined;
}
source.integration_config = undefined;
}
return new PagedResponseImpl(sources, {

4
packages/nocodb/src/services/sources.service.ts

@ -21,6 +21,10 @@ export class SourcesService {
async baseGetWithConfig(context: NcContext, param: { sourceId: any }) {
const source = await Source.get(context, param.sourceId);
if (!source) {
NcError.sourceNotFound(param.sourceId);
}
source.config = await source.getSourceConfig();
return source;

Loading…
Cancel
Save