Skip to content

Commit

Permalink
fix: get_data return a row with ["name", "image"], which cause fatal …
Browse files Browse the repository at this point in the history
…error in frontend
  • Loading branch information
vaclis_school committed Dec 3, 2024
1 parent c5a5a4e commit b5b44ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/v2/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ async def get_data(n: str, width: int, background_tasks: BackgroundTasks):
try:
worksheet = spreadsheet.worksheet(n)
values = worksheet.get_all_values()
truncated_values = [row[:width] for row in values]
truncated_values = [row[:width] for row in values[1:]]

# # 在讀取資料時觸發更新
# background_tasks.add_task(refresh_data)

return JSONResponse(content={"data": truncated_values})
return JSONResponse(content=truncated_values)
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))

Expand Down

0 comments on commit b5b44ff

Please sign in to comment.