Bladeren bron

console.log -> info

visuddhinanda 1 jaar geleden
bovenliggende
commit
0575807c95
1 gewijzigde bestanden met toevoegingen van 10 en 11 verwijderingen
  1. 10 11
      dashboard-v4/dashboard/src/components/share/CollaboratorAdd.tsx

+ 10 - 11
dashboard-v4/dashboard/src/components/share/CollaboratorAdd.tsx

@@ -43,19 +43,18 @@ const CollaboratorAddWidget = ({ resId, resType, onSuccess }: IWidget) => {
             res_id: resId,
             res_type: resType,
           };
-          console.log("create share", postData);
-          post<IShareRequest, IShareResponse>("/v2/share", postData).then(
-            (json) => {
-              console.log("add member", json);
-              if (json.ok) {
-                if (typeof onSuccess !== "undefined") {
-                  onSuccess();
-                }
-                formRef.current?.resetFields(["userId"]);
-                message.success(intl.formatMessage({ id: "flashes.success" }));
+          const url = "/v2/share";
+          console.info("share api request", url, postData);
+          post<IShareRequest, IShareResponse>(url, postData).then((json) => {
+            console.debug("share api response", json);
+            if (json.ok) {
+              if (typeof onSuccess !== "undefined") {
+                onSuccess();
               }
+              formRef.current?.resetFields(["userId"]);
+              message.success(intl.formatMessage({ id: "flashes.success" }));
             }
-          );
+          });
         }
       }}
     >