From 7b28973c60a23c6f5f6878e89a262680361454d4 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sun, 29 Jan 2023 13:20:18 -0900 Subject: [PATCH] fix: tree fixes (#252) * use case insensitive sort * support new location selector in create item * fix incorrect date-time parsing logic --- backend/internal/data/repo/repo_locations.go | 2 +- frontend/components/Item/CreateModal.vue | 2 +- frontend/lib/api/base/base-api.ts | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/internal/data/repo/repo_locations.go b/backend/internal/data/repo/repo_locations.go index a5ca126..4e72008 100644 --- a/backend/internal/data/repo/repo_locations.go +++ b/backend/internal/data/repo/repo_locations.go @@ -280,7 +280,7 @@ func (lr *LocationRepository) Tree(ctx context.Context, GID uuid.UUID, tq TreeQu FROM location_tree ORDER BY level, node_type DESC, -- sort locations before items - NAME;` + lower(NAME)` if tq.WithItems { itemQuery := ` diff --git a/frontend/components/Item/CreateModal.vue b/frontend/components/Item/CreateModal.vue index 5d297d2..5dfdc2a 100644 --- a/frontend/components/Item/CreateModal.vue +++ b/frontend/components/Item/CreateModal.vue @@ -2,7 +2,7 @@
- + (obj: T, keys: Array = []): T { return; } - // Ensure date like format YYYY/MM/DD - otherwise results will be 1 day off - const dateStr: string = result[key].split("T")[0].replace(/-/g, "/"); - result[key] = new Date(dateStr); + result[key] = new Date(result[key]); } });