Skip to content

Commit 97383b7

Browse files
committed
fix: wrong body
1 parent c31dea1 commit 97383b7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/api/Action/action-components/SingleValueActionComponent.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {
2+
ActionPostRequest,
23
GeneralParameterType,
34
TypedActionParameter,
45
} from '../../actions-spec.ts';
@@ -23,14 +24,17 @@ export class SingleValueActionComponent extends AbstractActionComponent {
2324
return this._parentComponent ?? null;
2425
}
2526

26-
protected buildBody(account: string) {
27-
if (this._href.indexOf(`{${this.parameter.name}}`) > -1) {
27+
protected buildBody(account: string): ActionPostRequest<any> {
28+
if (
29+
this._href.indexOf(`{${this.parameter.name}}`) > -1 ||
30+
this.parameterValue === null
31+
) {
2832
return { account };
2933
}
3034

3135
return {
3236
account,
33-
params: {
37+
data: {
3438
[this.parameter.name]: this.parameterValue,
3539
},
3640
};

0 commit comments

Comments
 (0)