From 9f6812ba8c14cd4d7b653e2f600f53e0232611b5 Mon Sep 17 00:00:00 2001 From: sachinkadam Date: Tue, 2 Jul 2024 22:23:44 +0530 Subject: [PATCH] avniproject/avni-webapp#1209 | Rename the dashboard if it is voided to support same name --- .../src/main/java/org/avni/server/service/DashboardService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/avni-server-api/src/main/java/org/avni/server/service/DashboardService.java b/avni-server-api/src/main/java/org/avni/server/service/DashboardService.java index f8344ccbf..cd4ee8e32 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/DashboardService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/DashboardService.java @@ -4,6 +4,7 @@ import org.avni.server.domain.*; import org.avni.server.domain.app.dashboard.DashboardFilter; import org.avni.server.util.BadRequestError; +import org.avni.server.util.ReactAdminUtil; import org.avni.server.web.contract.reports.DashboardBundleContract; import org.avni.server.web.contract.reports.DashboardSectionBundleContract; import org.avni.server.web.contract.reports.DashboardSectionCardMappingBundleContract; @@ -93,6 +94,7 @@ public Dashboard editDashboard(DashboardWebRequest dashboardRequest, Long dashbo public void deleteDashboard(Dashboard dashboard) { dashboard.setVoided(true); + dashboard.setName((ReactAdminUtil.getVoidedName(dashboard.getName(), dashboard.getId()))); dashboardRepository.save(dashboard); }