Skip to content

Commit

Permalink
reverted typescript changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FitseTLT committed Jan 19, 2024
1 parent 9dbde5a commit 87bbdc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Str from 'expensify-common/lib/str';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PersonalDetailsList, Policy, PolicyMembers, PolicyTags} from '@src/types/onyx';
import type {PersonalDetailsList, Policy, PolicyMembers, PolicyTag, PolicyTags} from '@src/types/onyx';
import type {EmptyObject} from '@src/types/utils/EmptyObject';
import {isEmptyObject} from '@src/types/utils/EmptyObject';

Expand Down Expand Up @@ -158,7 +158,7 @@ function getIneligibleInvitees(policyMembers: OnyxEntry<PolicyMembers>, personal
/**
* Gets the tag from policy tags, defaults to the first if no key is provided.
*/
function getTag(policyTags: OnyxEntry<Record<string, PolicyTags>>, tagKey?: keyof typeof policyTags): PolicyTags | undefined | EmptyObject {
function getTag(policyTags: OnyxEntry<PolicyTags>, tagKey?: keyof typeof policyTags): PolicyTag | undefined | EmptyObject {
if (isEmptyObject(policyTags)) {
return {};
}
Expand All @@ -171,7 +171,7 @@ function getTag(policyTags: OnyxEntry<Record<string, PolicyTags>>, tagKey?: keyo
/**
* Gets the first tag name from policy tags.
*/
function getTagListName(policyTags: OnyxCollection<PolicyTags>) {
function getTagListName(policyTags: OnyxEntry<PolicyTags>) {
if (Object.keys(policyTags ?? {})?.length === 0) {
return '';
}
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Violations/ViolationsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Onyx from 'react-native-onyx';
import type {Phrase, PhraseParameters} from '@libs/Localize';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PolicyCategories, PolicyTag, Transaction, TransactionViolation} from '@src/types/onyx';
import type {PolicyCategories, PolicyTags, Transaction, TransactionViolation} from '@src/types/onyx';

const ViolationsUtils = {
/**
Expand All @@ -14,7 +14,7 @@ const ViolationsUtils = {
transaction: Transaction,
transactionViolations: TransactionViolation[],
policyRequiresTags: boolean,
policyTags: Record<string, PolicyTag>,
policyTags: PolicyTags,
policyRequiresCategories: boolean,
policyCategories: PolicyCategories,
): {
Expand Down
6 changes: 1 addition & 5 deletions src/types/onyx/PolicyTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ type PolicyTag = {
'GL Code': string;
};

type PolicyTags = {
name: string;
required: boolean;
tags: Record<string, PolicyTag>;
};
type PolicyTags = Record<string, PolicyTag>;

export type {PolicyTag, PolicyTags};

0 comments on commit 87bbdc6

Please sign in to comment.