From 625680e411746172e7c47c0cbd7d88e521ab056a Mon Sep 17 00:00:00 2001 From: Samuel Whittenberger Date: Sat, 4 Jan 2025 14:14:56 -0500 Subject: [PATCH] fix duplicate id of different type not being accepted --- openlibrary/components/IdentifiersInput.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlibrary/components/IdentifiersInput.vue b/openlibrary/components/IdentifiersInput.vue index fed98e8b574..a9949f8aad8 100644 --- a/openlibrary/components/IdentifiersInput.vue +++ b/openlibrary/components/IdentifiersInput.vue @@ -155,7 +155,8 @@ export default { this.inputValue = this.inputValue.replace(/\s/g, '') } if (this.isEdition) { - const existingIds = Object.values(this.assignedIdentifiers).flat(); + // collect id values of matching type, or empty array if none present + const existingIds = this.assignedIdentifiers[this.selectedIdentifier] ?? []; const validEditionId = validateEditionIdentifiers(this.selectedIdentifier, this.inputValue, existingIds); if (validEditionId) { if (!this.assignedIdentifiers[this.selectedIdentifier]) {