Skip to content

Commit e10c846

Browse files
authored
fix: all the current blocking issues (#724)
* fix: admin not being able to add tracks * fix: filter for cohort selection
2 parents f885800 + 6ff0e70 commit e10c846

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

apps/web/app/api/AddTracks/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export async function POST(req: NextRequest) {
1414
const notion = new NotionAPI();
1515
try {
1616
const recordMap = await notion.getPage(notionId);
17-
const data = Object.keys(recordMap.block).map((key) => {
17+
const data = Object.keys(recordMap.block).filter((key) => {
18+
const block = recordMap.block[key];
19+
return block?.role !== "none"
20+
}).map((key) => {
1821
const block = recordMap.block[key];
1922
return {
2023
notionDocId: block?.value.id,

apps/web/components/Hero.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ export default function Hero({ tracks }: { tracks: TrackPros[] }) {
115115
gradientUnits="userSpaceOnUse"
116116
gradientTransform="matrix(12.12436 -7 4.2 7.27461 16 16)"
117117
>
118-
<stop stop-color="#7D7D7D" />
119-
<stop offset=".267" stop-color="#7E7C7A" />
120-
<stop offset=".45" stop-color="#817871" />
121-
<stop offset=".608" stop-color="#867162" />
122-
<stop offset=".753" stop-color="#8D684C" />
123-
<stop offset=".886" stop-color="#965C30" />
124-
<stop offset="1" stop-color="#A04F12" />
118+
<stop stopColor="#7D7D7D" />
119+
<stop offset=".267" stopColor="#7E7C7A" />
120+
<stop offset=".45" stopColor="#817871" />
121+
<stop offset=".608" stopColor="#867162" />
122+
<stop offset=".753" stopColor="#8D684C" />
123+
<stop offset=".886" stopColor="#965C30" />
124+
<stop offset="1" stopColor="#A04F12" />
125125
</radialGradient>
126126
</defs>
127127
</motion.svg>

apps/web/components/Tracks.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,7 @@ export const Tracks = ({ tracks, categories }: TracksWithCategoriesProps) => {
6161

6262
const filterTracks = () => {
6363
setLoading(true);
64-
let newFilteredTracks = tracks;
65-
if (selectedCohort) {
66-
newFilteredTracks = newFilteredTracks.filter((t) => t.cohort === selectedCohort);
67-
}
68-
if (selectedCategory && selectedCategory !== "All") {
69-
newFilteredTracks = newFilteredTracks.filter((t) =>
70-
t.categories.some((c) => c.category.category === selectedCategory)
71-
);
72-
}
73-
setFilteredTracks(newFilteredTracks);
64+
setFilteredTracks(tracks.filter((t) => selectedCohort === 3 ? t.cohort === 3 : t.cohort !== 3));
7465
setCurrentPage(1); // Reset to first page on filtering
7566
setLoading(false);
7667
};

apps/web/components/admin/CompleteTrackCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const CompleteTrackCard = ({ notionId, TrackData }: { notionId: string; TrackDat
3434
problems: problems,
3535
selectedCategory: TrackData.selectedCategory,
3636
cohort: parseInt(TrackData.cohort),
37+
trackType: "NOTION",
3738
});
3839
await insertData(TrackData.trackId);
3940
setIsSubmitting(true);

apps/web/tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module.exports = {
33
darkMode: ["class"],
44
content: [
5-
"../../packages/ui/**/*.{ts,tsx}",
5+
"../../packages/ui/src/**/*.{ts,tsx}",
66
"./app/**/*.{ts,tsx}",
77
"./pages/**/*.{ts,tsx}",
88
"./components/**/*.{ts,tsx}",

0 commit comments

Comments
 (0)