Skip to content

Commit 5caf40d

Browse files
Minor changes
1 parent a87f11b commit 5caf40d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/components/Comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Comment = ({comment, user, handleDeleteComment}) => {
1818

1919
{comment.owner === null ?
2020
(<> </>)
21-
: (<> {comment.owner.login === user.login ?
21+
: (<> {user !== undefined && comment.owner.login === user.login ?
2222
(
2323
<>
2424
<button className="input-submit" onClick={() => handleDeleteComment(comment.id)}>Supprimer</button>

src/components/DrinkDetails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const DrinkDetails = props => {
8080
)
8181
}
8282

83-
{props.user === "-1" ? (
83+
{props.user === undefined ? (
8484
<></>
8585
) :
8686
(

src/components/WorkshopDetails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const WorkshopDetails = props => {
8787
)
8888
}
8989

90-
{props.login === "-1" ? (
90+
{props.user === undefined ? (
9191
<></>
9292
) :
9393
(

src/components/WorkshopsList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const WorkshopsList = props => {
2828
setWorkshopIntensityUnity("");
2929
setWorkshopDescription("");
3030

31-
setWorkshops([...workshops, {title: workshopTitle, description: workshopDescription, perfUnity: workshopPerfUnity, intensityUnity: workshopIntensityUnity}])
31+
setWorkshops([...workshops, {id: response.data.id, title: workshopTitle, description: workshopDescription, perfUnity: workshopPerfUnity, intensityUnity: workshopIntensityUnity}])
3232
}, error => console.log(error));
3333
}
3434

@@ -57,7 +57,7 @@ const WorkshopsList = props => {
5757
</tbody>
5858
</Table>
5959

60-
{props.user.login === undefined || props.user.role !== "ROLE_ADMIN" ? (
60+
{props.user === undefined || props.user.role !== "ROLE_ADMIN" ? (
6161
<></>
6262
) :
6363
(

0 commit comments

Comments
 (0)