Skip to content

Commit e9878b4

Browse files
committed
Support snake payload
1 parent 9690499 commit e9878b4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/resources/wizard-task/reader.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class Reader {
1515
resource_id: resource.id,
1616
},
1717
payload: {
18-
resourceId: resource.id,
18+
resource_id: resource.id,
1919
},
2020
namespaceId: resource.namespaceId,
2121
userId: user.id,

src/wizard/processors/collect.processor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export class CollectProcessor extends Processor {
1313
}
1414

1515
async process(task: Task): Promise<Record<string, any>> {
16-
if (!task.payload?.resourceId) {
16+
const resourceId = task.payload?.resource_id || task.payload?.resourceId;
17+
if (!resourceId) {
1718
throw new BadRequestException('Invalid task payload');
1819
}
19-
const resourceId = task.payload.resourceId;
2020
if (task.exception) {
2121
const user = await this.userService.find(task.userId);
2222
if (user) {

src/wizard/wizard.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class WizardService {
7272
const resource = await this.resourcesService.create(user, resourceDto);
7373
console.debug({ resource });
7474

75-
const payload = { resourceId: resource.id };
75+
const payload = { resource_id: resource.id };
7676

7777
const task = await this.create({
7878
function: 'collect',

0 commit comments

Comments
 (0)