Skip to content

Commit

Permalink
Merge pull request #51811 from Expensify/dangrous-changedelegateparam…
Browse files Browse the repository at this point in the history
…name

Update param to delegateEmail
  • Loading branch information
aldo-expensify authored Dec 9, 2024
2 parents af78a37 + a166ca1 commit ccc1ddc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/libs/API/parameters/AddDelegateParams.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {DelegateRole} from '@src/types/onyx/Account';

type AddDelegateParams = {
delegate: string;
delegateEmail: string;
role: DelegateRole;
validateCode: string;
};
Expand Down
2 changes: 1 addition & 1 deletion src/libs/API/parameters/RemoveDelegateParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type RemoveDelegateParams = {
delegate: string;
delegateEmail: string;
};

export default RemoveDelegateParams;
2 changes: 1 addition & 1 deletion src/libs/API/parameters/UpdateDelegateRoleParams.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {DelegateRole} from '@src/types/onyx/Account';

type UpdateDelegateRoleParams = {
delegate: string;
delegateEmail: string;
role: DelegateRole;
validateCode: string;
};
Expand Down
8 changes: 4 additions & 4 deletions src/libs/actions/Delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {NativeModules} from 'react-native';
import Onyx from 'react-native-onyx';
import type {OnyxUpdate} from 'react-native-onyx';
import * as API from '@libs/API';
import type {AddDelegateParams, RemoveDelegateParams} from '@libs/API/parameters';
import type {AddDelegateParams, RemoveDelegateParams, UpdateDelegateRoleParams} from '@libs/API/parameters';
import {SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
import * as ErrorUtils from '@libs/ErrorUtils';
import Log from '@libs/Log';
Expand Down Expand Up @@ -330,7 +330,7 @@ function addDelegate(email: string, role: DelegateRole, validateCode: string) {
},
];

const parameters: AddDelegateParams = {delegate: email, validateCode, role};
const parameters: AddDelegateParams = {delegateEmail: email, validateCode, role};

API.write(WRITE_COMMANDS.ADD_DELEGATE, parameters, {optimisticData, successData, failureData});
}
Expand Down Expand Up @@ -402,7 +402,7 @@ function removeDelegate(email: string) {
},
];

const parameters: RemoveDelegateParams = {delegate: email};
const parameters: RemoveDelegateParams = {delegateEmail: email};

API.write(WRITE_COMMANDS.REMOVE_DELEGATE, parameters, {optimisticData, successData, failureData});
}
Expand Down Expand Up @@ -519,7 +519,7 @@ function updateDelegateRole(email: string, role: DelegateRole, validateCode: str
},
];

const parameters = {delegate: email, validateCode, role};
const parameters: UpdateDelegateRoleParams = {delegateEmail: email, validateCode, role};

API.write(WRITE_COMMANDS.UPDATE_DELEGATE_ROLE, parameters, {optimisticData, successData, failureData});
}
Expand Down

0 comments on commit ccc1ddc

Please sign in to comment.