Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

fix: tree fixes (#252)

Hayden7b28973c60a2
diff --git a/backend/internal/data/repo/repo_locations.go b/backend/internal/data/repo/repo_locations.go
index a5ca126a..4e720084 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 5d297d2c..5dfdc2ad 100644
--- a/frontend/components/Item/CreateModal.vue
+++ b/frontend/components/Item/CreateModal.vue
@@ -2,7 +2,7 @@
<BaseModal v-model="modal">
<template #title> Create Item </template>
<form @submit.prevent="create(true)">
- <FormSelect v-model="form.location" label="Location" :items="locations ?? []" />
+ <LocationSelector v-model="form.location" />
<FormTextField
ref="locationNameRef"
v-model="form.name"
diff --git a/frontend/lib/api/base/base-api.ts b/frontend/lib/api/base/base-api.ts
index 0138b5ba..089cfe6e 100644
--- a/frontend/lib/api/base/base-api.ts
+++ b/frontend/lib/api/base/base-api.ts
@@ -26,9 +26,7 @@ export function parseDate<T>(obj: T, keys: Array<keyof T> = []): 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]);
}
});