From e0116417f7012a4b2f26e6c91f62ca42f21a8de2 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sat, 15 Oct 2022 12:07:40 -0800 Subject: [PATCH] use group settings for format currency --- backend/app/api/v1/v1_ctrl_group.go | 1 + frontend/components/global/Currency.vue | 22 +++++++++++++++++++ .../global/DetailsSection/DetailsSection.vue | 9 ++++---- .../components/global/DetailsSection/types.ts | 22 ++++++++++++++----- frontend/composables/use-formatters.ts | 21 ++++++++++++++++++ frontend/lib/data/currency.ts | 4 +++- frontend/pages/item/[id]/index.vue | 14 +++++++----- frontend/pages/label/[id].vue | 4 ++-- frontend/pages/location/[id].vue | 4 ++-- frontend/pages/profile.vue | 4 +++- 10 files changed, 82 insertions(+), 23 deletions(-) create mode 100644 frontend/components/global/Currency.vue create mode 100644 frontend/composables/use-formatters.ts diff --git a/backend/app/api/v1/v1_ctrl_group.go b/backend/app/api/v1/v1_ctrl_group.go index ac8ce79..e8bd796 100644 --- a/backend/app/api/v1/v1_ctrl_group.go +++ b/backend/app/api/v1/v1_ctrl_group.go @@ -41,6 +41,7 @@ func (ctrl *V1Controller) HandleGroupGet() http.HandlerFunc { server.RespondError(w, http.StatusInternalServerError, err) return } + group.Currency = strings.ToUpper(group.Currency) // TODO: Hack to fix the currency enums being lower caseĆ server.Respond(w, http.StatusOK, group) diff --git a/frontend/components/global/Currency.vue b/frontend/components/global/Currency.vue new file mode 100644 index 0000000..9a2c561 --- /dev/null +++ b/frontend/components/global/Currency.vue @@ -0,0 +1,22 @@ + + {{ value }} + + + diff --git a/frontend/components/global/DetailsSection/DetailsSection.vue b/frontend/components/global/DetailsSection/DetailsSection.vue index f8ee495..6b083e3 100644 --- a/frontend/components/global/DetailsSection/DetailsSection.vue +++ b/frontend/components/global/DetailsSection/DetailsSection.vue @@ -7,9 +7,8 @@