chore: remove and replace log with info

This commit is contained in:
Tristan Yang
2022-09-01 18:34:59 +08:00
parent ffbdc212f7
commit 3247de57db
36 changed files with 37 additions and 77 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ const whiteList = [
const baseQuery = fetchBaseQuery({
baseUrl: BASE_URL,
prepareHeaders: (headers, { getState, endpoint }) => {
console.log("req", endpoint);
console.info("req", endpoint);
const { token } = (getState() as RootState).authData;
if (token && !whiteList.includes(endpoint)) {
headers.set(tokenHeader, token);
@@ -73,7 +73,7 @@ const baseQueryWithTokenCheck = async (args, api, extraOptions) => {
result = await baseQuery(args, api, extraOptions);
}
if (result?.error) {
console.log("api error", result.error, api.endpoint);
console.error("api error", result.error, api.endpoint);
switch (result.error.originalStatus || result.error.status) {
case "FETCH_ERROR":
{
+4 -4
View File
@@ -31,7 +31,7 @@ export const channelApi = createApi({
await queryFulfilled;
dispatch(removeChannel(gid));
} catch {
console.log("channel update failed");
console.error("channel update failed");
}
}
}),
@@ -54,7 +54,7 @@ export const channelApi = createApi({
try {
await queryFulfilled;
} catch {
console.log("channel update failed");
console.error("channel update failed");
}
}
}),
@@ -115,7 +115,7 @@ export const channelApi = createApi({
dispatch(removeReactionMessage(mids));
}
} catch {
console.log("remove channel error");
console.error("remove channel error");
}
}
}),
@@ -178,7 +178,7 @@ export const channelApi = createApi({
})
);
} catch (error) {
console.log("err", error);
console.error("err", error);
}
}
})
-1
View File
@@ -56,7 +56,6 @@ export const onMessageSendStarted = async (
}, 300);
// dispatch(removePendingMessage({ id, mid:ts, type: from }));
} catch {
console.log("message send failed");
toast.error("Send Message Failed");
dispatch(removeContextMessage({ id, mid: ts }));
dispatch(removeMessage(ts));
-1
View File
@@ -57,7 +57,6 @@ export const messageApi = createApi({
body: formData
}),
transformResponse: (data: UploadFileResponse | null) => {
console.log("upload file response", data);
return data ? data : {};
}
}),
+2 -2
View File
@@ -31,7 +31,7 @@ export const serverApi = createApi({
const logo = `${BASE_URL}/resource/organization/logo?t=${+new Date()}`;
dispatch(updateInfo({ ...server, logo }));
} catch {
console.log("get server info error");
console.error("get server info error");
}
}
}),
@@ -146,7 +146,7 @@ export const serverApi = createApi({
})
);
} catch {
console.log("update server logo error");
console.error("update server logo error");
}
}
}),
-1
View File
@@ -89,7 +89,6 @@ const uiSlice = createSlice({
{
const { data } = rest;
const isArray = Array.isArray(data);
console.log("add opt", data, files, isArray);
if (files) {
if (isArray) {
data.forEach((item) => {