File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 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' ) || ' ' ;
480480 Authorization: ` Bearer ${headscaleAPIKey } `
481481 },
482482 body: JSON .stringify ({
483- user: user
483+ user: parseInt ( userID )
484484 })
485485 })
486486 .then ((response ) => {
Original file line number Diff line number Diff 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 > ) {
Original file line number Diff line number Diff line change 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)
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 -->
You can’t perform that action at this time.
0 commit comments