diff --git a/VERSION b/VERSION index a1ef0ca..2d6c0bc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.2 +5.0.4 diff --git a/play-life-backend/main.go b/play-life-backend/main.go index 21e0073..c17f328 100644 --- a/play-life-backend/main.go +++ b/play-life-backend/main.go @@ -4185,7 +4185,6 @@ func main() { adminAPIRoutes := r.PathPrefix("/").Subrouter() adminAPIRoutes.Use(app.authMiddleware) adminAPIRoutes.Use(app.adminMiddleware) - adminAPIRoutes.HandleFunc("/message/post", app.messagePostHandler).Methods("POST", "OPTIONS") adminAPIRoutes.HandleFunc("/weekly_goals/setup", app.weeklyGoalsSetupHandler).Methods("POST", "OPTIONS") adminAPIRoutes.HandleFunc("/daily-report/trigger", app.dailyReportTriggerHandler).Methods("POST", "OPTIONS") adminAPIRoutes.HandleFunc("/project_score_sample_mv/refresh", app.projectScoreSampleMvRefreshHandler).Methods("POST", "OPTIONS") @@ -4238,7 +4237,8 @@ func main() { // Projects & stats protected.HandleFunc("/api/weekly-stats", app.getWeeklyStatsHandler).Methods("GET", "OPTIONS") protected.HandleFunc("/playlife-feed", app.getWeeklyStatsHandler).Methods("GET", "OPTIONS") - // Note: /message/post, /weekly_goals/setup, /daily-report/trigger moved to adminAPIRoutes + protected.HandleFunc("/message/post", app.messagePostHandler).Methods("POST", "OPTIONS") + // Note: /weekly_goals/setup, /daily-report/trigger moved to adminAPIRoutes protected.HandleFunc("/projects", app.getProjectsHandler).Methods("GET", "OPTIONS") protected.HandleFunc("/project/priority", app.setProjectPriorityHandler).Methods("POST", "OPTIONS") protected.HandleFunc("/project/color", app.setProjectColorHandler).Methods("POST", "OPTIONS") @@ -14488,8 +14488,7 @@ func (a *App) getBoardCompletedHandler(w http.ResponseWriter, r *http.Request) { wi.image_path, wi.link, wi.completed, - wi.project_id AS item_project_id, - wp.name AS item_project_name, + wi.group_name AS item_group_name, wc.id AS condition_id, wc.display_order, wc.task_condition_id, @@ -14503,7 +14502,6 @@ func (a *App) getBoardCompletedHandler(w http.ResponseWriter, r *http.Request) { sc.start_date, COALESCE(u.name, u.email) AS user_name FROM wishlist_items wi - LEFT JOIN projects wp ON wi.project_id = wp.id AND wp.deleted = FALSE LEFT JOIN wishlist_conditions wc ON wi.id = wc.wishlist_item_id LEFT JOIN task_conditions tc ON wc.task_condition_id = tc.id LEFT JOIN tasks t ON tc.task_id = t.id AND t.deleted = FALSE @@ -14533,8 +14531,7 @@ func (a *App) getBoardCompletedHandler(w http.ResponseWriter, r *http.Request) { var imagePath sql.NullString var link sql.NullString var completed bool - var itemProjectID sql.NullInt64 - var itemProjectName sql.NullString + var itemGroupName sql.NullString var conditionID sql.NullInt64 var displayOrder sql.NullInt64 var taskConditionID sql.NullInt64 @@ -14549,7 +14546,7 @@ func (a *App) getBoardCompletedHandler(w http.ResponseWriter, r *http.Request) { var userName sql.NullString err := rows.Scan( - &itemID, &name, &price, &imagePath, &link, &completed, &itemProjectID, &itemProjectName, + &itemID, &name, &price, &imagePath, &link, &completed, &itemGroupName, &conditionID, &displayOrder, &taskConditionID, &scoreConditionID, &userIDCond, &taskID, &taskName, &projectID, &projectName, &requiredPoints, &startDate, &userName, ) @@ -14579,8 +14576,9 @@ func (a *App) getBoardCompletedHandler(w http.ResponseWriter, r *http.Request) { if link.Valid { item.Link = &link.String } - // Для завершённых желаний не устанавливаем project_id и project_name - // Они отображаются отдельно без группировки по проектам + if itemGroupName.Valid && itemGroupName.String != "" { + item.GroupName = &itemGroupName.String + } itemsMap[itemID] = item } diff --git a/play-life-web/package.json b/play-life-web/package.json index 1ed6a2d..833d9bf 100644 --- a/play-life-web/package.json +++ b/play-life-web/package.json @@ -1,6 +1,6 @@ { "name": "play-life-web", - "version": "5.0.2", + "version": "5.0.4", "type": "module", "scripts": { "dev": "vite", diff --git a/play-life-web/src/components/Wishlist.jsx b/play-life-web/src/components/Wishlist.jsx index 4a2c6c9..fb28fa9 100644 --- a/play-life-web/src/components/Wishlist.jsx +++ b/play-life-web/src/components/Wishlist.jsx @@ -221,7 +221,9 @@ function Wishlist({ onNavigate, refreshTrigger = 0, isActive = false, initialBoa const response = await authFetch(`${API_URL}/boards/${selectedBoardId}/completed`) if (!response.ok) { - throw new Error('Ошибка при загрузке завершённых желаний') + const errText = await response.text() + const msg = errText || 'Ошибка при загрузке завершённых желаний' + throw new Error(msg) } const data = await response.json()