Skip to content

Commit

Permalink
only set the sections if sections is array
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu committed Dec 11, 2024
1 parent b7614c4 commit 511b991
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/services/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export interface Project {
// Transform backend response to frontend format
const transformProject = (project: ProjectResponse): Project => {
let sections: ProjectSection[] = [];
if (project.Sections) {

if (project.Sections && Array.isArray(project.Sections)) {
sections = project.Sections.map(s => ({
id: s.id,
title: s.title || '',
Expand Down

0 comments on commit 511b991

Please sign in to comment.