Ignore:
Timestamp:
11/23/22 12:15:28 (20 months ago)
Author:
unknown <mlviktor23@…>
Branches:
main
Children:
af801e3, e49d1b6
Parents:
c68150f
Message:

moderation/reporting api in spring boot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Components/OpinionTree.js

    rc68150f r3b6962d  
    4242
    4343  useEffect(() => {
    44     const url = `http://192.168.0.17:8080/secure/currentUser`;
     44    const url = `http://192.168.0.19:8080/secure/currentUser`;
    4545
    4646    const fetchUser = async () => {
     
    6868      ) {
    6969        const response = await axios(
    70           `http://192.168.0.17:8080/secure/upvoteOpinion/${post.postId}`,
     70          `http://192.168.0.19:8080/secure/upvoteOpinion/${post.postId}`,
    7171          {
    7272            method: "get",
     
    9191      ) {
    9292        const response = await axios(
    93           `http://192.168.0.17:8080/secure/downvoteOpinion/${post.postId}`,
     93          `http://192.168.0.19:8080/secure/downvoteOpinion/${post.postId}`,
    9494          {
    9595            method: "get",
     
    111111      setReplyModalDisplay("block");
    112112      setPostForModal(opinion);
     113      document.body.style.overflowY = "hidden";
    113114    } else {
    114115      navigate("/login");
     
    118119  const handleModalCloseClick = () => {
    119120    setReplyModalDisplay("none");
     121    document.body.style.overflowY = "auto";
    120122  };
    121123
     
    129131    if (!replyContent.length < 1) {
    130132      const response = await axios(
    131         `http://192.168.0.17:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`,
     133        `http://192.168.0.19:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`,
    132134        {
    133135          method: "post",
     
    159161              {child.content}
    160162            </p>
    161             <OpinionReplyCardContentTime>
    162               {dateConverter(
    163                 new Date(child.timePosted).toString().slice(4, -43)
    164               )}
    165             </OpinionReplyCardContentTime>
     163            {child.timePosted === child.timeLastEdited ? (
     164              <OpinionCardContentTime>
     165                {dateConverter(
     166                  new Date(child.timePosted).toString().slice(4, -43)
     167                )}
     168              </OpinionCardContentTime>
     169            ) : (
     170              <OpinionCardContentTime>
     171                {dateConverter(
     172                  new Date(child.timeLastEdited).toString().slice(4, -43)
     173                )}{" "}
     174                (едитирано од модератор)
     175              </OpinionCardContentTime>
     176            )}
    166177
    167178            <div
     
    181192                        (e) => e.vote === "UPVOTE" && e.user.id === user.id
    182193                      )
    183                       ? "greenyellow"
     194                      ? "green"
    184195                      : "darkgrey"
    185196                    : "darkgrey"
     
    249260                    {opinion.content}
    250261                  </p>
    251                   <OpinionCardContentTime>
    252                     {dateConverter(
    253                       new Date(opinion.timePosted).toString().slice(4, -43)
    254                     )}
    255                   </OpinionCardContentTime>
     262                  {opinion.timePosted === opinion.timeLastEdited ? (
     263                    <OpinionCardContentTime>
     264                      {dateConverter(
     265                        new Date(opinion.timePosted).toString().slice(4, -43)
     266                      )}
     267                    </OpinionCardContentTime>
     268                  ) : (
     269                    <OpinionCardContentTime>
     270                      {dateConverter(
     271                        new Date(opinion.timeLastEdited)
     272                          .toString()
     273                          .slice(4, -43)
     274                      )}{" "}
     275                      (едитирано од модератор)
     276                    </OpinionCardContentTime>
     277                  )}
    256278
    257279                  <div
     
    273295                                e.vote === "UPVOTE" && e.user.id === user.id
    274296                            )
    275                             ? "greenyellow"
     297                            ? "green"
    276298                            : "darkgrey"
    277299                          : "darkgrey"
     
    343365                    value={replyContent}
    344366                    onChange={handleContentChange}
     367                    spellCheck={false}
    345368                  />
    346369                </label>
Note: See TracChangeset for help on using the changeset viewer.