diff --git a/src/routes/(app)/devices/new/+page.server.ts b/src/routes/(app)/devices/new/+page.server.ts
index 733ff30..dd2cbf2 100644
--- a/src/routes/(app)/devices/new/+page.server.ts
+++ b/src/routes/(app)/devices/new/+page.server.ts
@@ -27,7 +27,7 @@ const deviceSchema = z.object({
});
export const load: PageServerLoad = async () => {
- const locationList = await db.select({ id: locations.id, name: locations.name }).from(locations);
+ const locationList = await db.select({ id: locations.id, name: locations.name, parentId: locations.parentId }).from(locations).orderBy(locations.name);
return { locations: locationList };
};
diff --git a/src/routes/(app)/devices/new/+page.svelte b/src/routes/(app)/devices/new/+page.svelte
index 55979bd..6586dcd 100644
--- a/src/routes/(app)/devices/new/+page.svelte
+++ b/src/routes/(app)/devices/new/+page.svelte
@@ -2,6 +2,7 @@
import { enhance } from '$app/forms';
import { DEVICE_CATEGORIES, DEVICE_CONDITIONS, VOLTAGE_OPTIONS, FREQUENCY_OPTIONS } from '$lib/constants.js';
import AutocompleteInput from '$lib/components/ui/AutocompleteInput.svelte';
+ import LocationPicker from '$lib/components/ui/LocationPicker.svelte';
let { data, form } = $props();
@@ -179,14 +180,8 @@
Location & Notes
-
-
+ Location
+
diff --git a/src/routes/(app)/installations/new/+page.server.ts b/src/routes/(app)/installations/new/+page.server.ts
index bffa69a..bc3a738 100644
--- a/src/routes/(app)/installations/new/+page.server.ts
+++ b/src/routes/(app)/installations/new/+page.server.ts
@@ -32,8 +32,9 @@ export const load: PageServerLoad = async ({ url }) => {
.from(components)
.orderBy(components.title);
const locationList = await db
- .select({ id: locations.id, name: locations.name })
- .from(locations);
+ .select({ id: locations.id, name: locations.name, parentId: locations.parentId })
+ .from(locations)
+ .orderBy(locations.name);
return {
devices: deviceList,
diff --git a/src/routes/(app)/installations/new/+page.svelte b/src/routes/(app)/installations/new/+page.svelte
index 27763c3..9c83238 100644
--- a/src/routes/(app)/installations/new/+page.svelte
+++ b/src/routes/(app)/installations/new/+page.svelte
@@ -1,6 +1,7 @@