fix(rust): name the servers in a refused restore
The walk read "is on rust-oxide"; it now reads the server's name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -221,7 +221,9 @@ async function restore(id) {
|
||||
if (!existing.replaced) throw new NpcError('this profile is in use already')
|
||||
const clash = active(await db.listProfiles()).find((p) => p.name === existing.name && existing.servers.some((s) => covers(p, s)))
|
||||
if (clash) {
|
||||
throw new NpcError(`the site's profile "${clash.name}" is on ${existing.servers.join(', ')}: change its servers or delete it first`, 409)
|
||||
const names = new Map((await db.listNpcServers()).map((srv) => [srv.id, srv.name || srv.id]))
|
||||
const where = existing.servers.map((id) => names.get(id) || id).join(', ')
|
||||
throw new NpcError(`the site's profile "${clash.name}" is on ${where}: change its servers or delete it first`, 409)
|
||||
}
|
||||
await db.saveProfile({ ...existing, replaced: false })
|
||||
await db.markDirty(existing.servers)
|
||||
|
||||
Reference in New Issue
Block a user