Skip to content

Commit c0abcad

Browse files
authored
Merge pull request #58 from CEIT-SSC/teams
filtered active presentations
2 parents b50eaee + 6807b3b commit c0abcad

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

apps/game_craft/components/features/workshops/OfflineWorkshop.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ export function OfflineWorkshop({
3636
)
3737
.then((response) => {
3838
if (response.status === 200) {
39+
const filteredData = response.data.data;
40+
filteredData.results = filteredData.results.filter(
41+
(presentation) => presentation.is_active
42+
);
43+
3944
setPresentations({
4045
loading: false,
41-
data: response.data.data,
46+
data: filteredData,
4247
});
4348
} else {
4449
setPresentations({ loading: false, error: "failed to fetch" });

apps/game_craft/components/features/workshops/OnlineWorkshop.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ export function OnlineWorkshop({
4040
)
4141
.then((response) => {
4242
if (response.status === 200) {
43+
const filteredData = response.data.data;
44+
filteredData.results = filteredData.results.filter(
45+
(presentation) => presentation.is_active
46+
);
47+
4348
setPresentations({
4449
loading: false,
45-
data: response.data.data,
50+
data: filteredData,
4651
});
4752
} else {
4853
setPresentations({ loading: false, error: "failed to fetch" });

0 commit comments

Comments
 (0)