Mercurial > gemma
changeset 1349:6720d683f7ca
Marshall JSON of SoundingResultDate correctly so it can be unmarshalled later on.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 26 Nov 2018 12:53:15 +0100 |
parents | c539cb678c5b |
children | 58d41573e530 |
files | pkg/models/sr.go |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/models/sr.go Mon Nov 26 11:50:48 2018 +0100 +++ b/pkg/models/sr.go Mon Nov 26 12:53:15 2018 +0100 @@ -53,6 +53,10 @@ WHERE bn.objnam = $1 AND sr.date_info = $2` ) +func (srd SoundingResultDate) MarshalJSON() ([]byte, error) { + return json.Marshal(srd.Format(SoundingResultDateFormat)) +} + func (srd *SoundingResultDate) UnmarshalJSON(data []byte) error { var s string if err := json.Unmarshal(data, &s); err != nil {