Mercurial > gemma
comparison pkg/controllers/importqueue.go @ 1355:b0ebb77f4ab0
Return nice JSON result if import was accepted or declined.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 26 Nov 2018 15:52:30 +0100 |
parents | 89d013d55ec9 |
children | 3ff916e853d4 |
comparison
equal
deleted
inserted
replaced
1354:1000e0e71d5a | 1355:b0ebb77f4ab0 |
---|---|
389 | 389 |
390 if _, err = tx.ExecContext(ctx, reviewSQL, state, who, id); err != nil { | 390 if _, err = tx.ExecContext(ctx, reviewSQL, state, who, id); err != nil { |
391 return | 391 return |
392 } | 392 } |
393 | 393 |
394 err = tx.Commit() | 394 if err = tx.Commit(); err != nil { |
395 return | |
396 } | |
397 | |
398 result := struct { | |
399 Message string `json:"message"` | |
400 }{ | |
401 Message: fmt.Sprintf("Import #%d successfully changed to state '%s'.", | |
402 id, state), | |
403 } | |
404 | |
405 jr = JSONResult{Result: &result} | |
395 return | 406 return |
396 } | 407 } |