feat: add blocks for loyalty page
This commit is contained in:
17
utils/contactConfig.ts
Normal file
17
utils/contactConfig.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import {
|
||||
ContactConfig,
|
||||
ContactFieldGroups,
|
||||
} from "@/types/requests/contactConfig"
|
||||
|
||||
export function getValueFromContactConfig(
|
||||
keyStrings: string,
|
||||
data: ContactConfig
|
||||
): string | undefined {
|
||||
const [groupName, key] = keyStrings.split(".") as [
|
||||
ContactFieldGroups,
|
||||
keyof ContactConfig[ContactFieldGroups],
|
||||
]
|
||||
const fieldGroup = data[groupName]
|
||||
|
||||
return fieldGroup[key]
|
||||
}
|
||||
Reference in New Issue
Block a user