From 2f0238e14747a02f614cff4b88a55314187c2a28 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Fri, 10 Mar 2023 21:34:50 +0800 Subject: [PATCH] Simplified console.logs on APIs --- src/Components/Api/Api.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Components/Api/Api.tsx b/src/Components/Api/Api.tsx index 755aca1..b68da2e 100644 --- a/src/Components/Api/Api.tsx +++ b/src/Components/Api/Api.tsx @@ -50,11 +50,11 @@ export function UpdateProduct(product: UpdateProductParams) { } ) .then((response) => { - console.log("Product update successful", response.data); + console.log("Product update successful"); return response.data; }) .catch((error) => { - console.log("Error updating product", error.response); + console.log("Error updating product"); return error; }); } @@ -97,7 +97,7 @@ export function AddProduct(note: AddProductParams) { return response.data; }) .catch((error) => { - console.log("Error adding product", error.response); + console.log("Error adding product"); return error; }); } @@ -114,7 +114,7 @@ export function DeleteProduct(id: number) { } ) .catch((error) => { - console.log("Error deleting product", error.response); + console.log("Error deleting product"); return error; }); } @@ -132,7 +132,7 @@ export function UserRegister(register: RegistrationParams) { return true; }) .catch((error) => { - console.log("Registration failed: " + error.response); + console.log("Registration failed"); return false; }); } @@ -152,7 +152,7 @@ export function UserLogin(user: LoginParams) { return true; }) .catch((error) => { - console.log("Login Failed: " + error.response); + console.log("Login Failed"); return false; }); } @@ -170,7 +170,7 @@ export function UserInfo() { return response.data; }) .catch((error) => { - console.log("Error retrieving user data", error.response); + console.log("Error retrieving user data"); return false; }); } @@ -184,11 +184,11 @@ export function QueryUser(id: number) { }, }) .then((response) => { - console.log("Querying one user...", response.data); + console.log("Success querying one user"); return response.data; }) .catch((error) => { - console.log("Error retrieving single user data", error.response); + console.log("Error querying one user"); return false; }); } @@ -204,7 +204,7 @@ export function UserActivate(activation: ActivationParams) { return true; }) .catch((error) => { - console.log("Activation failed: " + error.response); + console.log("Activation failed"); return false; }); }