Changes in reactapp/src/Pages/Topic.js [af801e3:3b6962d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/Pages/Topic.js
raf801e3 r3b6962d 28 28 } from "../Components/Styled/Modal.style"; 29 29 import axios from "../api/axios"; 30 import LoadingSpinner from "../Components/Styled/LoadingSpinner.style";31 30 32 31 const Topic = () => { … … 49 48 50 49 useEffect(() => { 51 const url1 = `http://192.168.0. 29:8080/public/thread/${params.topicId}`;52 const url2 = `http://192.168.0. 29:8080/secure/currentUser`;50 const url1 = `http://192.168.0.19:8080/public/thread/${params.topicId}`; 51 const url2 = `http://192.168.0.19:8080/secure/currentUser`; 53 52 54 53 const fetchTopic = async () => { … … 100 99 if (!replyContent.length < 1) { 101 100 const response = await axios( 102 `http://192.168.0. 29:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,101 `http://192.168.0.19:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`, 103 102 { 104 103 method: "post", … … 110 109 ); 111 110 setErrorMessage(""); 112 window.location.reload( );111 window.location.reload(false); 113 112 } else { 114 113 setErrorMessage("Полето за содржина не смее да биде празно"); … … 129 128 if (!postContent.length < 1) { 130 129 const response = await axios( 131 `http://192.168.0. 29:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,130 `http://192.168.0.19:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`, 132 131 { 133 132 method: "post", … … 139 138 ); 140 139 setErrorMessage(""); 141 window.location.reload( );140 window.location.reload(false); 142 141 } else { 143 142 setErrorMessage("Полето за содржина не смее да биде празно"); … … 161 160 ) { 162 161 const response = await axios( 163 `http://192.168.0. 29:8080/secure/upvoteThread/${post.postId}`,162 `http://192.168.0.19:8080/secure/upvoteThread/${post.postId}`, 164 163 { 165 164 method: "get", … … 167 166 } 168 167 ); 169 window.location.reload( );168 window.location.reload(false); 170 169 } else { 171 170 return; … … 184 183 ) { 185 184 const response = await axios( 186 `http://192.168.0. 29:8080/secure/downvoteThread/${post.postId}`,185 `http://192.168.0.19:8080/secure/downvoteThread/${post.postId}`, 187 186 { 188 187 method: "get", … … 191 190 ); 192 191 193 window.location.reload( );192 window.location.reload(false); 194 193 } else { 195 194 return; … … 214 213 {child.content} 215 214 </p> 216 { new Date(child.timePosted).setMilliseconds(0) === new Date(child.timeLastEdited).setMilliseconds(0)? (215 {thread.timePosted === thread.timeLastEdited ? ( 217 216 <OpinionCardContentTime> 218 217 {dateConverter( 219 new Date( child.timePosted).toString().slice(4, -43)220 )} <span style={{fontStyle:"normal",color:"blue"}}>#{child.postId}</span>218 new Date(thread.timePosted).toString().slice(4, -43) 219 )} 221 220 </OpinionCardContentTime> 222 221 ) : ( 223 222 <OpinionCardContentTime> 224 223 {dateConverter( 225 new Date( child.timeLastEdited).toString().slice(4, -43)226 )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{child.postId}</span>{" "}224 new Date(thread.timeLastEdited).toString().slice(4, -43) 225 )}{" "} 227 226 (едитирано од модератор) 228 227 </OpinionCardContentTime> … … 271 270 /> 272 271 273 <VoteCount right={ 10 + "px"}>272 <VoteCount right={50 + "px"}> 274 273 {child.votes.filter((v) => v.vote === "DOWNVOTE").length} 275 274 </VoteCount> … … 325 324 </CurrentPageNav> 326 325 <div style={{ height: "20px", marginBottom: "50px", marginTop: "50px" }}> 327 <h3 style={{ float: "left" }}>{thread.title} <span style={{opacity:"50%", fontSize:"16px"}}>#{thread.postId}</span></h3>326 <h3 style={{ float: "left" }}>{thread.title}</h3> 328 327 {auth && ( 329 328 <AddOpinionButton onClick={handleAddOpinionButtonClick}> … … 370 369 {thread.content} 371 370 </p> 372 { new Date(thread.timePosted).setMilliseconds(0) === new Date(thread.timeLastEdited).setMilliseconds(0)? (371 {thread.timePosted === thread.timeLastEdited ? ( 373 372 <OpinionCardContentTime> 374 373 {dateConverter( 375 374 new Date(thread.timePosted).toString().slice(4, -43) 376 )} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span>375 )} 377 376 </OpinionCardContentTime> 378 377 ) : ( … … 380 379 {dateConverter( 381 380 new Date(thread.timeLastEdited).toString().slice(4, -43) 382 )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span>{" "}381 )}{" "} 383 382 (едитирано од модератор) 384 383 </OpinionCardContentTime> … … 445 444 {directChild.content} 446 445 </p> 447 { new Date(directChild.timePosted).setMilliseconds(0) === new Date(directChild.timeLastEdited).setMilliseconds(0)? (446 {directChild.timePosted === directChild.timeLastEdited ? ( 448 447 <OpinionCardContentTime> 449 448 {dateConverter( 450 449 new Date(directChild.timePosted).toString().slice(4, -43) 451 )} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span>450 )} 452 451 </OpinionCardContentTime> 453 452 ) : ( … … 457 456 .toString() 458 457 .slice(4, -43) 459 )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span>{" "}458 )}{" "} 460 459 (едитирано од модератор) 461 460 </OpinionCardContentTime> … … 560 559 ) : !fetchError && !loadedThread ? ( 561 560 <div> 562 < LoadingSpinner style={{ marginTop: "140px" }}/>561 <p style={{ marginTop: "140px" }}>се вчитува...</p> 563 562 <Outlet /> 564 563 </div>
Note:
See TracChangeset
for help on using the changeset viewer.