Skip to content

Commit

Permalink
fix(tab): allow default period
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Aug 25, 2024
1 parent 58c6e32 commit 8bd3de5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/decoders/tab.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Period, Tab } from "~/models";

export const decodeTab = (tab: any, instancePeriods: Period[]): Tab => {
const find = (p1: any) => instancePeriods.find((p2) => p2.id === p1.N);
const find = (id: string) => instancePeriods.find((p2) => p2.id === id);

const defaultPeriod = find(tab.periodeParDefaut?.V);
const defaultPeriod = tab.periodeParDefaut && find(tab.periodeParDefaut.V.N);
const periods = tab.listePeriodes.V.map((p1: any) => find(p1)).filter(Boolean);

return {
Expand Down

0 comments on commit 8bd3de5

Please sign in to comment.