feat(hosts): generate unique 8-digit asset ID
Add a Generate button to the host create dialog that fetches a random 8-digit asset ID from the new GET /hosts/generate-asset-id endpoint. The service retries against the unique index so the returned ID is guaranteed unused. Edit mode hides the button. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -42,3 +42,8 @@ export async function updateHost(id: string, input: UpdateHostRequest): Promise<
|
||||
export async function deleteHost(id: string): Promise<void> {
|
||||
await api.delete(`/hosts/${id}`);
|
||||
}
|
||||
|
||||
export async function generateHostAssetId(): Promise<{ assetId: string }> {
|
||||
const res = await api.get<{ assetId: string }>('/hosts/generate-asset-id');
|
||||
return res.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user