Add project variants and UI updates
This commit is contained in:
@@ -66,7 +66,7 @@ func (h *ExportHandler) ExportCSV(c *gin.Context) {
|
||||
// Try to load project name from database
|
||||
username := middleware.GetUsername(c)
|
||||
if project, err := h.projectService.GetByUUID(req.ProjectUUID, username); err == nil && project != nil {
|
||||
projectName = project.Name
|
||||
projectName = derefString(project.Name)
|
||||
}
|
||||
}
|
||||
if projectName == "" {
|
||||
@@ -90,6 +90,13 @@ func (h *ExportHandler) ExportCSV(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func derefString(value *string) string {
|
||||
if value == nil {
|
||||
return ""
|
||||
}
|
||||
return *value
|
||||
}
|
||||
|
||||
func (h *ExportHandler) buildExportData(req *ExportRequest) *services.ExportData {
|
||||
items := make([]services.ExportItem, len(req.Items))
|
||||
var total float64
|
||||
@@ -171,7 +178,7 @@ func (h *ExportHandler) ExportConfigCSV(c *gin.Context) {
|
||||
projectName := config.Name // fallback: use config name if no project
|
||||
if config.ProjectUUID != nil && *config.ProjectUUID != "" {
|
||||
if project, err := h.projectService.GetByUUID(*config.ProjectUUID, username); err == nil && project != nil {
|
||||
projectName = project.Name
|
||||
projectName = derefString(project.Name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user