1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-10-31 00:07:43 +02:00

API: Sort tags before saving

Tags should be alphabetically sorted before saving. Whilst this was the behavior with automated tagging, it did not apply to manually set tags via the API.
This commit is contained in:
Ralph Slooten
2023-06-13 16:57:42 +12:00
parent adce75ab8f
commit ff9a6ff491

View File

@@ -22,6 +22,8 @@ func SetTags(id string, tags []string) error {
}
}
sort.Strings(applyTags)
tagJSON, err := json.Marshal(applyTags)
if err != nil {
logger.Log().Errorf("[db] setting tags for message %s", id)