chore: refacto
This commit is contained in:
@@ -8,13 +8,13 @@ import (
|
||||
|
||||
func (d *Database) GetDeliveryIssues(status string) ([]models.DeliveryIssue, error) {
|
||||
query := `
|
||||
SELECT id, command_id, issue_type, description, status,
|
||||
SELECT id, command_id, issue_type, description, status,
|
||||
reported_by, COALESCE(resolved_by, ''), COALESCE(resolution, ''),
|
||||
created_at, updated_at
|
||||
FROM delivery_issues
|
||||
`
|
||||
|
||||
var args []interface{}
|
||||
var args []any
|
||||
if status != "" {
|
||||
query += " WHERE status = $1"
|
||||
args = append(args, status)
|
||||
@@ -76,7 +76,6 @@ func (d *Database) CreateDeliveryIssue(commandID int, issueType, description, re
|
||||
return nil, fmt.Errorf("erreur création problème: %w", err)
|
||||
}
|
||||
|
||||
log.Printf("✅ Problème créé: ID=%d, Type=%s, Commande=%d", issue.ID, issueType, commandID)
|
||||
return &issue, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user