Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/posts #19

Open
wants to merge 42 commits into
base: temp/main1
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6438955
added frontend
ovindumandith Apr 29, 2024
1d74fe4
added ReplyModel for frontend
ovindumandith Apr 29, 2024
911570d
made changes to replymodel
ovindumandith Apr 29, 2024
8921b63
changes to frontend
ovindumandith Apr 29, 2024
20c6f4f
made changes to frontend
ovindumandith Apr 30, 2024
3338728
changes made to frontend of posts
ovindumandith Apr 30, 2024
72d0883
made xhanges to frontend
ovindumandith May 1, 2024
047e32e
frontend changes to user profile
ovindumandith May 1, 2024
dad8ca8
added DTO for comments and posts
ovindumandith May 1, 2024
4dd2d53
frontend changes made
ovindumandith May 1, 2024
0282712
added post shre class
ovindumandith May 2, 2024
86134b9
added post shre DTO class
ovindumandith May 2, 2024
7ed3e28
few refinements
ovindumandith May 2, 2024
fe246e2
frontend changes for posts
ovindumandith May 3, 2024
ae70466
Frontend link changes
ovindumandith May 3, 2024
f01a84f
Update README.md
IT21063596 May 7, 2024
5ff8efc
updated backend for posts,like and comments
ovindumandith May 7, 2024
a9545ec
updated backend for posts,like and comments with redux
ovindumandith May 7, 2024
f79e840
updated backend for posts,like and comments with redux and axios
ovindumandith May 8, 2024
b26615b
updated backend for posts,like and comments with redux and clodinary
ovindumandith May 8, 2024
f047549
Merge branch 'feature/posts' of https://github.com/PAF-IT3030/paf-ass…
ovindumandith May 8, 2024
c3f52aa
updated backend for edit posts
ovindumandith May 8, 2024
bffaed4
updated backend for edit posts and adding comments
ovindumandith May 9, 2024
a66c4e1
updated backend for post to pass the image URL to the DB
ovindumandith May 10, 2024
275baa7
updated frontend to send the image to S3 bucket
ovindumandith May 10, 2024
7aea21c
updated frontend to send the image to S3 bucket through .env
ovindumandith May 10, 2024
1ae3c9b
updated backend to modify the post entity
ovindumandith May 10, 2024
be59344
updated backend to modify the post entity
ovindumandith May 10, 2024
11e183d
updated fronted o handle edit of posts
ovindumandith May 10, 2024
4fceba0
updated fronted o handle edit of posts
ovindumandith May 10, 2024
9a0b21b
updated fronted to address the non sterlized values
ovindumandith May 10, 2024
009e5a8
updated fronted to address the non sterlized values
ovindumandith May 10, 2024
d16a42d
updated frontend for error correction in rendering of posts
ovindumandith May 10, 2024
3d7fbce
made api corrections for delete function
ovindumandith May 11, 2024
018cab3
added toaastify for alert functios
ovindumandith May 11, 2024
6156692
mapped backend and frontened to handle update posts
ovindumandith May 11, 2024
822d645
updated gitignore to avoid pushing secret keys
ovindumandith May 11, 2024
895aaac
updated gitignore to avoid pushing secret keys
ovindumandith May 11, 2024
dfb7b3a
updated gitignore to avoid pushing secret keys
ovindumandith May 11, 2024
a9dcc7f
updated gitignore to avoid pushing secret keys
ovindumandith May 11, 2024
52944f5
mapped backend and frontened to handle update posts
ovindumandith May 11, 2024
dfe561c
made cahanges for user profile to display the posts
ovindumandith May 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated fronted o handle edit of posts
ovindumandith committed May 10, 2024
commit 4fceba03350bce761c7c384227890dfa34de3ec0
31 changes: 16 additions & 15 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
"react-scripts": "^5.0.1",
"redux": "^5.0.1",
"redux-thunk": "^3.1.0",
"uuid": "^9.0.1",
"web-vitals": "^2.1.4",
"yup": "^1.4.0"
},
4 changes: 4 additions & 0 deletions frontend/src/Components/HomeSection/EditPost.jsx
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ import { Button, TextField } from "@mui/material";
import { useDispatch } from "react-redux";
import { updatePost } from "../Store/Action";
import { uploadToS3 } from "../Config/awsS3";
import { v4 as uuidv4 } from "uuid";

const EditPost = ({
initialCaption,
@@ -15,6 +16,9 @@ const EditPost = ({
const [caption, setCaption] = useState(initialCaption);
const [image, setImage] = useState(null);

const S3_BUCKET_NAME = process.env.REACT_APP_S3_BUCKET_NAME;
const S3_BUCKET_REGION = process.env.REACT_APP_S3_BUCKET_REGION;

const handleImageChange = (e) => {
setImage(e.target.files[0]);
};
2 changes: 1 addition & 1 deletion frontend/src/Components/Store/Action.js
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ export const updatePost = (postId, updatedPostData) => {
dispatch({ type: UPDATE_POST_REQUEST });
try {
const response = await axios.put(`/posts/${postId}`, updatedPostData);
dispatch({ type: UPDATE_POST_SUCCESS, payload: response.data });
dispatch({ type: UPDATE_POST_SUCCESS, payload: response.data }); // Assuming response.data contains the updated post data
} catch (error) {
dispatch({ type: UPDATE_POST_FAILURE, payload: error.message });
}
4 changes: 3 additions & 1 deletion frontend/src/Components/Store/Reducer.js
Original file line number Diff line number Diff line change
@@ -56,14 +56,16 @@ export const postReducer = (state = initialState, action) => {
posts: [...state.posts, action.payload],
};
case UPDATE_POST_SUCCESS:
const updatedPost = action.payload; // Assuming action.payload contains only the updated post data
const updatedPosts = state.posts.map((post) =>
post.id === action.payload.id ? action.payload : post
post.id === updatedPost.id ? updatedPost : post
);
return {
...state,
loading: false,
posts: updatedPosts,
};

case DELETE_POST_SUCCESS:
const filteredPosts = state.posts.filter(
(post) => post.id !== action.payload