Skip to content

Commit baffa00

Browse files
authored
fix undocumented headscale ui change (#207)
1 parent 15c4dd9 commit baffa00

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lib/common/apiFunctions.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@
464464
});
465465
}
466466
467-
export async function moveDevice(deviceID: string, user: string): Promise<any> {
467+
export async function moveDevice(deviceID: string, userID: string): Promise<any> {
468468
469469
// variables in local storage
470470
let headscaleURL = localStorage.getItem('headscaleURL') || '';
@@ -480,7 +480,7 @@
480480
Authorization: `Bearer ${headscaleAPIKey}`
481481
},
482482
body: JSON.stringify({
483-
user: user
483+
user: parseInt(userID)
484484
})
485485
})
486486
.then((response) => {

src/lib/common/classes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class Device {
1010
public approvedRoutes: string[] = [];
1111
public availableRoutes: string[] = [];
1212
public subnetRoutes: string[] = [];
13-
public user: { name: string } = { name: '' };
13+
public user: User = new User();
1414
public online?: boolean;
1515

1616
public constructor(init?: Partial<Device>) {

src/lib/devices/DeviceCard/MoveDevice.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
export let device = new Device();
88
let deviceMoving = false;
9-
let selectedUser = device.user.name;
9+
let selectedUser = device.user.id;
1010
1111
function moveDeviceAction() {
1212
moveDevice(device.id, selectedUser)
@@ -39,7 +39,7 @@
3939
<form on:submit|preventDefault={moveDeviceAction}>
4040
<select class="card-select mr-3" required bind:value={selectedUser}>
4141
{#each $userStore as user}
42-
<option>{user.name}</option>
42+
<option value={user.id}>{user.name}</option>
4343
{/each}
4444
</select>
4545
<!-- edit accept symbol -->

0 commit comments

Comments
 (0)