Skip to content

Commit

Permalink
fix(context): merge request option issue
Browse files Browse the repository at this point in the history
Co-authored-by: Mohammad Honarvar <honarvar.info@gmail.com>
Co-authored-by: S. Amir Mohammad Najafi <njfamirm@gmail.com>
  • Loading branch information
3 people committed Mar 19, 2023
1 parent 5a6106d commit e24e695
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/context/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ finiteStateMachineProvider.defineActions<ServerContextFsm>(serverContextFsmConst

try {
const {response, options} = fsm.getContext();
if (options == null) return logger.error('action_request', 'invalid_fetch_options', {id: fsm.id});
if (options == null || options.url == null) {
return logger.error('action_request', 'invalid_fetch_options', {id: fsm.id, options});
}
const newResponse = await serviceRequest<NonNullable<ServerContextFsmContext['response']>>(
options as StringifyableFetchOptions,
);
Expand Down Expand Up @@ -170,6 +172,7 @@ export const setOptions = (
// prettier-ignore
fsm.setContext({
options: merge === false ? options : {
...oldOptions,
...options,
queryParameters: {
...oldOptions?.queryParameters,
Expand Down

0 comments on commit e24e695

Please sign in to comment.