5.0.4: Добавление записей для не-админов
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m22s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m22s
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user