Zugangslinks können gelöscht werden
DELETE-Endpoint im Backend, API-Client-Methode und Löschen-Button mit Bestätigungsdialog in der Anbieter-Admin-Oberfläche ergänzt. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -184,5 +184,17 @@ public class ProviderAdminResource {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DELETE
|
||||||
|
@Path("/access-links/{id}")
|
||||||
|
@Transactional
|
||||||
|
public Response deleteAccessLink(@PathParam("id") Long id) {
|
||||||
|
AccessLink link = AccessLink.findById(id);
|
||||||
|
if (link == null) {
|
||||||
|
return Response.status(Response.Status.NOT_FOUND).build();
|
||||||
|
}
|
||||||
|
link.delete();
|
||||||
|
return Response.noContent().build();
|
||||||
|
}
|
||||||
|
|
||||||
public record ProviderReportDto(String month, List<MonthlyReportDto> companies, long grandTotalCents) {}
|
public record ProviderReportDto(String month, List<MonthlyReportDto> companies, long grandTotalCents) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ export const api = {
|
|||||||
request<AccessLink>(`/admin/provider/access-links?token=${token}`, {
|
request<AccessLink>(`/admin/provider/access-links?token=${token}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({ role, companyId, description })
|
body: JSON.stringify({ role, companyId, description })
|
||||||
})
|
}),
|
||||||
|
deleteAccessLink: (token: string, id: number) =>
|
||||||
|
request<void>(`/admin/provider/access-links/${id}?token=${token}`, { method: 'DELETE' })
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -38,6 +38,12 @@
|
|||||||
setTimeout(() => { copiedLinkId = null; }, 2000);
|
setTimeout(() => { copiedLinkId = null; }, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function deleteAccessLink(id: number) {
|
||||||
|
if (!confirm('Diesen Zugangslink wirklich löschen?')) return;
|
||||||
|
await api.providerAdmin.deleteAccessLink(token, id);
|
||||||
|
accessLinks = await api.providerAdmin.getAccessLinks(token);
|
||||||
|
}
|
||||||
|
|
||||||
// Link Modal
|
// Link Modal
|
||||||
let showLinkModal = false;
|
let showLinkModal = false;
|
||||||
let formLinkRole = 'COMPANY_ADMIN';
|
let formLinkRole = 'COMPANY_ADMIN';
|
||||||
@@ -309,7 +315,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<table class="admin-table">
|
<table class="admin-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Beschreibung</th><th>Rolle</th><th>Firma</th><th>Link</th></tr>
|
<tr><th>Beschreibung</th><th>Rolle</th><th>Firma</th><th>Link</th><th></th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{#each accessLinks as link}
|
{#each accessLinks as link}
|
||||||
@@ -337,6 +343,13 @@
|
|||||||
<span class="copy-icon">{copiedLinkId === link.id ? '✓' : '⎘'}</span>
|
<span class="copy-icon">{copiedLinkId === link.id ? '✓' : '⎘'}</span>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<button
|
||||||
|
class="btn btn-secondary"
|
||||||
|
style="padding: 6px 12px; font-size: 0.85rem; color: #ff6b6b; border-color: #ff6b6b;"
|
||||||
|
on:click={() => deleteAccessLink(link.id)}
|
||||||
|
>Löschen</button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user