Skip to content

Commit 885469c

Browse files
remove clgs
1 parent 2683d5a commit 885469c

File tree

6 files changed

+21
-41
lines changed

6 files changed

+21
-41
lines changed

client/src/actions/commentAction.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const postComment = (msg, user_id, post_id) => async (dispatch) => {
2020
dispatch({ type: COMMENT_TOAST, payload: false });
2121
}, 5000);
2222
} catch (err) {
23-
console.log(err.message);
2423
}
2524
};
2625

@@ -29,6 +28,5 @@ export const getComments = (post_id) => async (dispatch) => {
2928
const res = await Axios.get(`/api/post/comment/all/${post_id}`);
3029
dispatch({ type: GET_COMMENTS, payload: res.data });
3130
} catch (err) {
32-
console.log(err.message);
3331
}
3432
};

client/src/actions/getPostAction.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const getPost = (post_id) => async (dispatch) => {
2929
dispatch({ type: GET_POST, payload: res.data }); // * this will fetch a single post given the post id
3030
}
3131
} catch (err) {
32-
console.log(err.message);
3332
}
3433
};
3534

@@ -58,7 +57,6 @@ export const uploadPost = (post, post_id) => async (dispatch) => {
5857
dispatch(loadUser());
5958
}
6059
} catch (err) {
61-
console.log(err);
6260
}
6361
};
6462

@@ -69,7 +67,6 @@ export const uploadImage = (fData) => async (dispatch) => {
6967
const res = await axios.post("/api/upload", fData);
7068
dispatch({ type: GET_POST_ID, payload: res.data._id });
7169
} catch (err) {
72-
console.log("Upload ERR: ->>", err);
7370
}
7471
};
7572

@@ -80,7 +77,6 @@ export const getUserPosts = (user_id) => async (dispatch) => {
8077
dispatch({ type: GET_USER_POSTS, payload: res.data });
8178
}
8279
} catch (err) {
83-
console.log(err);
8480
}
8581
};
8682

@@ -91,7 +87,6 @@ export const deletePost = (post_id) => async (dispatch) => {
9187
dispatch({ type: DELETE_POST, payload: res.data });
9288
}
9389
} catch (err) {
94-
console.log(err);
9590
}
9691
};
9792

@@ -106,7 +101,6 @@ export const savePost = (post_id) => async (dispatch) => {
106101
}, 5000);
107102
}
108103
} catch (err) {
109-
console.log(err);
110104
}
111105
};
112106

@@ -115,7 +109,6 @@ export const getSavedPosts = () => async (dispatch) => {
115109
const res = await axios.get("/api/save");
116110
dispatch({ type: GET_SAVED_POST, payload: res.data });
117111
} catch (err) {
118-
console.log(err);
119112
}
120113
};
121114

@@ -126,7 +119,6 @@ export const likePost = (post_id) => async (dispatch) => {
126119
dispatch({ type: LIKE_POST, payload: res.data });
127120
}
128121
} catch (err) {
129-
console.log(err);
130122
}
131123
};
132124

@@ -137,7 +129,6 @@ export const getLikedPosts = (user, post_id) => async (dispatch) => {
137129
dispatch({ type: GET_LIKED_POST, payload: res.data });
138130
}
139131
} catch (err) {
140-
console.log(err);
141132
}
142133
};
143134

@@ -146,7 +137,6 @@ export const reallyGetAllPosts = (userId) => async (dispatch) => {
146137
const res = await axios.get(`/api/post/real-all/${userId}`);
147138
dispatch({ type: REALLY_GET_ALL_POSTS, payload: res.data });
148139
} catch (error) {
149-
console.log(error.message);
150140
}
151141
};
152142

@@ -161,9 +151,7 @@ export const cleanGetPostAction = () => (dispatch) => {
161151
export const fetchPopularPosts = () => async (dispatch) => {
162152
try {
163153
const res = await axios.get("/api/post/5fc4c6a6cf07d202383aadcf");
164-
console.log(res.data);
165154
// dispatch({ type: , payload: res.data });
166155
} catch (err) {
167-
console.log("Error Fetching All Articles");
168156
}
169157
};

client/src/actions/profileAction.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const uploadProfilePhoto = (formData) => async (dispatch) => {
1616
const res = await Axios.post("/api/upload/profile", formData);
1717
dispatch({ type: PROFILE_PHOTO, payload: res.data });
1818
} catch (err) {
19-
console.log(err);
2019
}
2120
};
2221

@@ -27,7 +26,6 @@ export const loadProfile = () => async (dispatch) => {
2726
dispatch({ type: GET_PROFILE, payload: res.data });
2827
}
2928
} catch (err) {
30-
console.log(err);
3129
}
3230
};
3331

@@ -41,7 +39,6 @@ export const editProfile = (fData) => async (dispatch) => {
4139

4240
dispatch({ type: EDIT_PROFILE, payload: res.data });
4341
} catch (err) {
44-
console.log(err);
4542
}
4643
};
4744

@@ -50,7 +47,6 @@ export const getThatProfileE = (userId) => async (dispatch) => {
5047
const res = await Axios.get(`/api/profile/${userId}`);
5148
dispatch({ type: GET_THAT_PROFILE, payload: res.data });
5249
} catch (err) {
53-
console.log(err.message);
5450
}
5551
};
5652

client/src/actions/trendingAction.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ export const getTrendingPosts = () => async (dispatch) => {
66
const res = await axios.get("/api/post/");
77
dispatch({ type: GET_TRENDING_POSTS, payload: res.data });
88
} catch (err) {
9-
console.log("Error Fetching All Articles");
109
}
1110
};

client/src/utils/estimateTime.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ export const getEstimatedTime = (contentString) => {
22
const contentArray = JSON.parse(contentString);
33

44
for (let i = 0; i < contentArray.length; i++) {
5-
// clg
65
}
76

8-
console.log(contentArray);
97

108
return "7 min";
119
};

client/src/utils/parseJSON.js

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
const parseJSON = (jsonOutput) => {
2-
let theHtmlString = '';
3-
jsonOutput.blocks.forEach((block) => {
4-
switch (block.type) {
5-
case 'header':
6-
theHtmlString += `<h${block.data.level}>${block.data.text}</h${block.data.level}>`;
7-
break;
8-
case 'paragraph':
9-
theHtmlString += `<p>${block.data.text}</p>`;
10-
break;
11-
case 'image':
12-
theHtmlString += `<img src=${block.data.url}></img>`;
13-
break;
14-
case 'code':
15-
theHtmlString += `<code>${block.data.code}</code>`;
16-
break;
17-
default:
18-
console.log(block.type);
19-
}
20-
});
2+
let theHtmlString = "";
3+
jsonOutput.blocks.forEach((block) => {
4+
switch (block.type) {
5+
case "header":
6+
theHtmlString += `<h${block.data.level}>${block.data.text}</h${block.data.level}>`;
7+
break;
8+
case "paragraph":
9+
theHtmlString += `<p>${block.data.text}</p>`;
10+
break;
11+
case "image":
12+
theHtmlString += `<img src=${block.data.url}></img>`;
13+
break;
14+
case "code":
15+
theHtmlString += `<code>${block.data.code}</code>`;
16+
break;
17+
default:
18+
const i = 0;
19+
i++;
20+
}
21+
});
2122

22-
return theHtmlString;
23+
return theHtmlString;
2324
};
2425

2526
export default parseJSON;

0 commit comments

Comments
 (0)