chore: remove unused filter modal

remove old cms model

refactor reward types
This commit is contained in:
Christian Andolf
2025-03-18 09:19:05 +01:00
parent 45d57a9c89
commit f272dde1ef
23 changed files with 345 additions and 891 deletions
+4 -6
View File
@@ -1,5 +1,5 @@
import type { Reward } from "@/types/components/myPages/rewards"
import type { ComparisonLevel } from "@/types/components/overviewTable"
import type { CMSReward } from "@/types/trpc/routers/contentstack/reward"
export function getGroupedRewards(levels: ComparisonLevel[]) {
const allRewards = levels
@@ -8,7 +8,7 @@ export function getGroupedRewards(levels: ComparisonLevel[]) {
})
.flat()
const mappedRewards = allRewards.reduce<Record<string, Reward[]>>(
const mappedRewards = allRewards.reduce<Record<string, CMSReward[]>>(
(acc, curr) => {
const taxonomiTerm = curr.taxonomies.find((tax) => tax.term_uid)?.term_uid
@@ -38,10 +38,8 @@ export function findAvailableRewards(
return level.rewards.find((r) => allRewardIds.includes(r.reward_id))
}
export function getGroupedLabelAndDescription(rewards: Reward[]) {
const reward = rewards.find(
(reward) => !!(reward.grouped_label && reward.grouped_label)
)
export function getGroupedLabelAndDescription(rewards: CMSReward[]) {
const reward = rewards.find((reward) => !!reward.grouped_label)
return {
label: reward?.grouped_label ?? "",
description: reward?.grouped_description ?? "",