Skip to content

Commit

Permalink
Make data optional
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Sep 14, 2023
1 parent 2e1a346 commit 5bb29ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libs/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Middleware = (response: unknown, request: Request, isFromSequentialQueue: b
let middlewares: Middleware[] = [];

function makeXHR(request: Request): Promise<unknown> {
const finalParameters = enhanceParameters(request.command, request.data);
const finalParameters = enhanceParameters(request.command, request?.data ?? {});
return NetworkStore.hasReadRequiredDataFromStorage().then(() => {
// If we're using the Supportal token and this is not a Supportal request
// let's just return a promise that will resolve itself.
Expand Down
2 changes: 1 addition & 1 deletion src/types/onyx/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {OnyxUpdate} from 'react-native-onyx';

type Request = {
command: string;
data: Record<string, unknown>;
data?: Record<string, unknown>;
type?: string;
shouldUseSecure?: boolean;
successData?: OnyxUpdate[];
Expand Down

0 comments on commit 5bb29ef

Please sign in to comment.