From 492f744d9d84289e27b2ddac9a9b4a2137fd11d6 Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期一, 07 八月 2023 11:25:24 +0800
Subject: [PATCH] slefreview

---
 force-app/main/default/lwc/lexCancelSubAuthorizedButton/lexCancelSubAuthorizedButton.js |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/force-app/main/default/lwc/lexCancelSubAuthorizedButton/lexCancelSubAuthorizedButton.js b/force-app/main/default/lwc/lexCancelSubAuthorizedButton/lexCancelSubAuthorizedButton.js
index b80663a..0a02d13 100644
--- a/force-app/main/default/lwc/lexCancelSubAuthorizedButton/lexCancelSubAuthorizedButton.js
+++ b/force-app/main/default/lwc/lexCancelSubAuthorizedButton/lexCancelSubAuthorizedButton.js
@@ -73,16 +73,19 @@
 			this.dispatchEvent(event3);
 			return;
 		}
-		await updateStatuById().then(result=>{
-			this.dispatchEvent(event2);
-			location.href = this.SubAuthorized.Id;
-		}).catch(error=>{
-			const eventError = new ShowToastEvent({
+		await updateStatuById({Id : this.recordId}).then(result=>{
+			if(result!='success'){
+				const eventError = new ShowToastEvent({
 	            	message:
-	                error.message,
+	                result,
 	                variant : 'error'
-			});
-			this.dispatchEvent(eventError);			
-		})
+				});
+				this.dispatchEvent(eventError);	
+			}
+			else{
+				this.dispatchEvent(event2);
+				location.href = this.SubAuthorized.Id;		
+			}
+		});
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1