Fix service point delete using wrong ID field
The API returns ServicePointID but portal.js was using sp.ID which was undefined. Changed all sp.ID references to sp.ServicePointID. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3d6856f108
commit
3d59a2e5cd
1 changed files with 4 additions and 4 deletions
|
|
@ -1680,8 +1680,8 @@ const Portal = {
|
|||
<div class="item-name">${this.escapeHtml(sp.Name)}</div>
|
||||
</div>
|
||||
<div class="item-actions">
|
||||
<button class="btn btn-sm btn-secondary" onclick="Portal.editServicePoint(${sp.ID})">Edit</button>
|
||||
<button class="btn btn-sm btn-danger" onclick="Portal.deleteServicePoint(${sp.ID})">Delete</button>
|
||||
<button class="btn btn-sm btn-secondary" onclick="Portal.editServicePoint(${sp.ServicePointID})">Edit</button>
|
||||
<button class="btn btn-sm btn-danger" onclick="Portal.deleteServicePoint(${sp.ServicePointID})">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
`).join('');
|
||||
|
|
@ -1945,7 +1945,7 @@ const Portal = {
|
|||
const assignedSPIds = new Set(this.assignments.map(a => a.ServicePointID));
|
||||
|
||||
const availableBeacons = this.beacons.filter(b => b.IsActive && !assignedBeaconIds.has(b.BeaconID));
|
||||
const availableSPs = this.servicePoints.filter(sp => !assignedSPIds.has(sp.ID));
|
||||
const availableSPs = this.servicePoints.filter(sp => !assignedSPIds.has(sp.ServicePointID));
|
||||
|
||||
if (availableBeacons.length === 0) {
|
||||
this.toast('No unassigned beacons available', 'warning');
|
||||
|
|
@ -1970,7 +1970,7 @@ const Portal = {
|
|||
<label>Service Point</label>
|
||||
<select id="assignServicePointId" class="form-input" required>
|
||||
<option value="">Select a service point...</option>
|
||||
${availableSPs.map(sp => `<option value="${sp.ID}">${this.escapeHtml(sp.Name)}</option>`).join('')}
|
||||
${availableSPs.map(sp => `<option value="${sp.ServicePointID}">${this.escapeHtml(sp.Name)}</option>`).join('')}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
|||
Reference in a new issue