From 7513e64f7c1d7a568539f89f1953c859d938aa3d Mon Sep 17 00:00:00 2001 From: zhangjingwei Date: Thu, 25 Jul 2024 10:51:49 +0800 Subject: [PATCH] fix: fix edit instance fix edit instance in the instance detail page for the non-admin user Change-Id: I300a3020b8402ca9638e1139a14c460a6a0a2660 --- src/stores/nova/instance.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/stores/nova/instance.js b/src/stores/nova/instance.js index beb4c5c7..797df048 100644 --- a/src/stores/nova/instance.js +++ b/src/stores/nova/instance.js @@ -116,11 +116,14 @@ export class ServerStore extends Base { noReminder: true, all_projects, }); - item.itemInList = result[0]; + item.itemInList = result.find((it) => it.id === id); } else { const store = new RecycleBinStore(); - const result = await store.fetchList({ uuid: id, all_projects }); - item.itemInList = result[0]; + const result = await store.fetchList({ + uuid: id, + all_projects, + }); + item.itemInList = result.find((it) => it.id === id); } } catch (e) { // eslint-disable-next-line no-console