Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/agent/src/routes/modification/action/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default class ActionRoute extends CollectionRoute {
this.getRecordSelection(context, false),
]);
const requestBody = context.request.body as SmartActionApprovalRequestBody;
const webAppURL: URL = new URL(context.request.url || context.request.originalUrl);

const canPerformCustomActionParams = {
caller,
Expand Down Expand Up @@ -103,7 +104,9 @@ export default class ActionRoute extends CollectionRoute {

// Now that we have the field list, we can parse the data again.
const data = ForestValueConverter.makeFormData(dataSource, rawData, fields);
const result = await this.collection.execute(caller, this.actionName, data, filterForCaller);
const result = await this.collection.execute(caller, this.actionName, data, filterForCaller, {
webAppURL,
});

if (result?.type === 'Error') {
context.response.status = HttpCode.BadRequest;
Expand Down
3 changes: 3 additions & 0 deletions packages/datasource-toolkit/src/interfaces/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export interface Collection {
name: string,
formValues: RecordData,
filter?: Filter,
additionalInformation?: {
webAppURL: URL;
},
): Promise<ActionResult>;

getForm(
Expand Down