Skip to content

Commit 24534d2

Browse files
committed
Fix OnyxUpdate TS errors
1 parent 273cb25 commit 24534d2

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/libs/actions/Domain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ function setDomainVacationDelegate(domainAccountID: number, domainMemberAccountI
12031203
},
12041204
];
12051205

1206-
const successData: OnyxUpdate[] = [
1206+
const successData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.DOMAIN | typeof ONYXKEYS.COLLECTION.DOMAIN_ERRORS | typeof ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS>> = [
12071207
{
12081208
onyxMethod: Onyx.METHOD.MERGE,
12091209
key: `${ONYXKEYS.COLLECTION.DOMAIN}${domainAccountID}`,
@@ -1237,7 +1237,7 @@ function setDomainVacationDelegate(domainAccountID: number, domainMemberAccountI
12371237
},
12381238
];
12391239

1240-
const failureData: OnyxUpdate[] = [
1240+
const failureData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.DOMAIN_ERRORS | typeof ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS>> = [
12411241
{
12421242
onyxMethod: Onyx.METHOD.MERGE,
12431243
key: `${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`,
@@ -1312,7 +1312,7 @@ function deleteDomainVacationDelegate(domainAccountID: number, domainMemberAccou
13121312
},
13131313
];
13141314

1315-
const successData: OnyxUpdate[] = [
1315+
const successData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS.COLLECTION.DOMAIN_ERRORS>> = [
13161316
{
13171317
onyxMethod: Onyx.METHOD.MERGE,
13181318
key: `${ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS}${domainAccountID}`,
@@ -1337,7 +1337,7 @@ function deleteDomainVacationDelegate(domainAccountID: number, domainMemberAccou
13371337
},
13381338
];
13391339

1340-
const failureData: OnyxUpdate[] = [
1340+
const failureData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.DOMAIN | typeof ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS.COLLECTION.DOMAIN_ERRORS>> = [
13411341
{
13421342
onyxMethod: Onyx.METHOD.MERGE,
13431343
key: `${ONYXKEYS.COLLECTION.DOMAIN}${domainAccountID}`,

src/libs/actions/Session/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ function setupNewDotAfterTransitionFromOldDot(hybridAppSettings: HybridAppSettin
726726
readyToShowAuthScreens: !hybridApp?.useNewDotSignInPage,
727727
};
728728

729-
const onyxUpdates: OnyxUpdate[] = [
729+
const onyxUpdates: Array<OnyxUpdate<typeof ONYXKEYS.HYBRID_APP | keyof typeof newDotOnyxValues>> = [
730730
{
731731
onyxMethod: Onyx.METHOD.MERGE,
732732
key: ONYXKEYS.HYBRID_APP,
@@ -739,7 +739,7 @@ function setupNewDotAfterTransitionFromOldDot(hybridAppSettings: HybridAppSettin
739739
onyxMethod: Onyx.METHOD.MERGE,
740740
key,
741741
value: value ?? {},
742-
} as OnyxUpdate);
742+
} as OnyxUpdate<keyof typeof newDotOnyxValues>);
743743
}
744744

745745
// Batch all merges together so they're processed atomically by Onyx

src/libs/actions/TravelInvoicing.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function clearTravelInvoicingSettlementFrequencyErrors(workspaceAccountID: numbe
249249
function toggleTravelInvoicing(policyID: string, workspaceAccountID: number, enabled: boolean) {
250250
const cardSettingsKey = getTravelInvoicingCardSettingsKey(workspaceAccountID);
251251

252-
const optimisticData: OnyxUpdate[] = [
252+
const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS>> = [
253253
{
254254
onyxMethod: Onyx.METHOD.MERGE,
255255
key: cardSettingsKey,
@@ -264,7 +264,7 @@ function toggleTravelInvoicing(policyID: string, workspaceAccountID: number, ena
264264
},
265265
];
266266

267-
const successData: OnyxUpdate[] = [
267+
const successData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS>> = [
268268
{
269269
onyxMethod: Onyx.METHOD.MERGE,
270270
key: cardSettingsKey,
@@ -278,7 +278,7 @@ function toggleTravelInvoicing(policyID: string, workspaceAccountID: number, ena
278278
];
279279

280280
// On failure: revert isEnabled and show error
281-
const failureData: OnyxUpdate[] = [
281+
const failureData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS>> = [
282282
{
283283
onyxMethod: Onyx.METHOD.MERGE,
284284
key: cardSettingsKey,

0 commit comments

Comments
 (0)