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()) { if (source.isMeta()) {
source.config = undefined; source.config = undefined;
} }
source.integration_config = undefined;
return source; return source;
} }
@ -60,6 +61,9 @@ export class SourcesController {
req, req,
}); });
source.config = undefined;
source.integration_config = undefined;
return source; return source;
} }
@ -77,9 +81,8 @@ export class SourcesController {
}); });
for (const source of sources) { for (const source of sources) {
if (source.isMeta()) {
source.config = undefined; source.config = undefined;
} source.integration_config = undefined;
} }
return new PagedResponseImpl(sources, { 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 }) { async baseGetWithConfig(context: NcContext, param: { sourceId: any }) {
const source = await Source.get(context, param.sourceId); const source = await Source.get(context, param.sourceId);
if (!source) {
NcError.sourceNotFound(param.sourceId);
}
source.config = await source.getSourceConfig(); source.config = await source.getSourceConfig();
return source; return source;

Loading…
Cancel
Save