From 16f789bdb48cf8eed78c0f08599bff118f6334ee Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Sat, 18 Sep 2021 12:49:51 +0200 Subject: [PATCH] Wrap locale language output into standard { set: [] } --- system/rest/locales.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/system/rest/locales.go b/system/rest/locales.go index 9a59ec5d1..c0e75aa56 100644 --- a/system/rest/locales.go +++ b/system/rest/locales.go @@ -16,12 +16,6 @@ import ( ) type ( - localeResponse struct { - Name string `json:"name"` - Self string `json:"self"` - Tag language.Tag `json:"code"` - } - Locale struct { svc service.ResourceTranslationService } @@ -43,7 +37,9 @@ func (Locale) New() *Locale { } func (ctrl Locale) List(ctx context.Context, r *request.LocaleList) (interface{}, error) { - return locale.Global().LocalizedList(ctx), nil + return struct { + Set []*locale.Language `json:"set"` + }{locale.Global().LocalizedList(ctx)}, nil } func (ctrl Locale) Get(ctx context.Context, r *request.LocaleGet) (interface{}, error) {