Browse Source

refactor: include request object in app-hook payload

pull/6894/head
Pranav C 1 year ago
parent
commit
55e0c6edbd
  1. 4
      packages/nocodb/src/controllers/auth/auth.controller.ts
  2. 4
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts
  3. 2
      packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts
  4. 2
      packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts
  5. 3
      packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts
  6. 1
      packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts
  7. 2
      packages/nocodb/src/services/sources.service.ts

4
packages/nocodb/src/controllers/auth/auth.controller.ts

@ -83,7 +83,7 @@ export class AuthController {
NcError.forbidden('Email authentication is disabled');
}
await this.setRefreshToken({ req, res });
res.json(await this.usersService.login(req.user));
res.json(await this.usersService.login(req.user, req));
}
@UseGuards(GlobalGuard)
@ -106,7 +106,7 @@ export class AuthController {
@UseGuards(PublicApiLimiterGuard, AuthGuard('google'))
async googleSignin(@Request() req, @Response() res) {
await this.setRefreshToken({ req, res });
res.json(await this.usersService.login(req.user));
res.json(await this.usersService.login(req.user, req));
}
@Get('/auth/google')

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

@ -1527,8 +1527,8 @@ export class AtImportProcessor {
url: attachment.url,
size: attachment.size,
mimetype: attachment.type,
req:{}
})),
})), req:{}
});
} catch (e) {
console.log(e);

2
packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts

@ -72,6 +72,7 @@ export class DuplicateController {
...(body.base || {}),
},
user: { id: req.user.id },
req
});
const job = await this.jobsService.add(JobTypes.DuplicateBase, {
@ -141,6 +142,7 @@ export class DuplicateController {
...(body.base || {}),
},
user: { id: req.user.id },
req
});
const job = await this.jobsService.add(JobTypes.DuplicateBase, {

2
packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts

@ -104,12 +104,14 @@ export class DuplicateProcessor {
status: null,
},
user: req.user,
req
});
} catch (e) {
if (dupProject?.id) {
await this.projectsService.baseSoftDelete({
baseId: dupProject.id,
user: req.user,
req
});
}
throw e;

3
packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts

@ -21,11 +21,12 @@ export class MetaSyncProcessor {
} = job.data;
if (info.sourceId === 'all') {
await this.metaDiffsService.metaDiffSync({ baseId: info.baseId });
await this.metaDiffsService.metaDiffSync({ baseId: info.baseId, req: {} });
} else {
await this.metaDiffsService.baseMetaDiffSync({
baseId: info.baseId,
sourceId: info.sourceId,
req: {}
});
}

1
packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts

@ -18,6 +18,7 @@ export class SourceDeleteProcessor {
await this.sourcesService.baseDelete({
sourceId,
req: {}
});
this.debugLog(`job completed for ${job.id}`);

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

@ -53,7 +53,7 @@ export class SourcesService {
return sources;
}
async baseDelete(param: { sourceId: string; req:any}) {
async baseDelete(param: { sourceId: string; req: any}) {
try {
const source = await Source.get(param.sourceId, true);
await source.delete();

Loading…
Cancel
Save