From b4151f03c853d3f13bc02d840994ac13524bc308 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Fri, 5 Jan 2024 11:59:08 -0600 Subject: [PATCH] implement selecting dynamic currency options --- backend/app/api/main.go | 4 ++++ frontend/lib/api/classes/group.ts | 14 +++++++++++++- frontend/pages/profile.vue | 21 +++++++++++++++++---- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/backend/app/api/main.go b/backend/app/api/main.go index 07b8e8d..8b0c844 100644 --- a/backend/app/api/main.go +++ b/backend/app/api/main.go @@ -133,6 +133,10 @@ func run(cfg *config.Config) error { } if cfg.CurrencyConfig != "" { + log.Info(). + Str("path", cfg.CurrencyConfig). + Msg("loading currency config file") + content, err := os.ReadFile(cfg.CurrencyConfig) if err != nil { log.Fatal(). diff --git a/frontend/lib/api/classes/group.ts b/frontend/lib/api/classes/group.ts index 7468f09..963157f 100644 --- a/frontend/lib/api/classes/group.ts +++ b/frontend/lib/api/classes/group.ts @@ -1,5 +1,11 @@ import { BaseAPI, route } from "../base"; -import { Group, GroupInvitation, GroupInvitationCreate, GroupUpdate } from "../types/data-contracts"; +import { + CurrenciesCurrency, + Group, + GroupInvitation, + GroupInvitationCreate, + GroupUpdate, +} from "../types/data-contracts"; export class GroupApi extends BaseAPI { createInvitation(data: GroupInvitationCreate) { @@ -21,4 +27,10 @@ export class GroupApi extends BaseAPI { url: route("/groups"), }); } + + currencies() { + return this.http.get({ + url: route("/currencies"), + }); + } } diff --git a/frontend/pages/profile.vue b/frontend/pages/profile.vue index bc3273a..ae9cb2d 100644 --- a/frontend/pages/profile.vue +++ b/frontend/pages/profile.vue @@ -1,7 +1,6 @@