diff --git a/server/model/npcs/npcs.model.js b/server/model/npcs/npcs.model.js index 4bf4398..7d2e613 100644 --- a/server/model/npcs/npcs.model.js +++ b/server/model/npcs/npcs.model.js @@ -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)