Fakultas Ilmu Komputer UI

Commit 227981cb authored by jonathanchandra15's avatar jonathanchandra15
Browse files

fix conflict

parents 977a55d7 cb75a485
[{"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\index.js":"1","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\reportWebVitals.js":"2","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\App.js":"3","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\TopicList.js":"4","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\RegisterForm.js":"5","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\LoginForm.js":"6","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\CreateTopicForm.js":"7","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Topic.js":"8","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Navbar.js":"9","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Search.js":"10","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\ListThreads.js":"11","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Profile\\Profile.js":"12","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Thread.js":"13","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\loggedInService.js":"14","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\api_link.js":"15","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth.service.js":"16","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth-header.js":"17","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\hooks\\input-hook.js":"18","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CommentList.js":"19","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Button.js":"20","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Post.js":"21","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\helpers\\time-util.js":"22","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\TopThreads.js":"23","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\PreviewThread.js":"24","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\RecentThreads.js":"25","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CreateThread.js":"26","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormCreateThread.js":"27","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\EditThread.js":"28","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormEditThread.js":"29"},{"size":517,"mtime":1608489407339,"results":"30","hashOfConfig":"31"},{"size":375,"mtime":1608489407340,"results":"32","hashOfConfig":"31"},{"size":1597,"mtime":1610534118377,"results":"33","hashOfConfig":"31"},{"size":1225,"mtime":1610538246495,"results":"34","hashOfConfig":"31"},{"size":3505,"mtime":1610536658090,"results":"35","hashOfConfig":"31"},{"size":2840,"mtime":1610536107826,"results":"36","hashOfConfig":"31"},{"size":1118,"mtime":1610508966367,"results":"37","hashOfConfig":"31"},{"size":2036,"mtime":1610539390632,"results":"38","hashOfConfig":"31"},{"size":2515,"mtime":1610529895964,"results":"39","hashOfConfig":"31"},{"size":1387,"mtime":1610448859126,"results":"40","hashOfConfig":"31"},{"size":2275,"mtime":1610450399349,"results":"41","hashOfConfig":"31"},{"size":2665,"mtime":1610536072547,"results":"42","hashOfConfig":"31"},{"size":4254,"mtime":1610531118152,"results":"43","hashOfConfig":"31"},{"size":103,"mtime":1610376399652,"results":"44","hashOfConfig":"31"},{"size":115,"mtime":1610376399606,"results":"45","hashOfConfig":"31"},{"size":1011,"mtime":1610376399638,"results":"46","hashOfConfig":"31"},{"size":209,"mtime":1610376399607,"results":"47","hashOfConfig":"31"},{"size":374,"mtime":1609624159225,"results":"48","hashOfConfig":"31"},{"size":709,"mtime":1610376399571,"results":"49","hashOfConfig":"31"},{"size":310,"mtime":1609672020693,"results":"50","hashOfConfig":"31"},{"size":3794,"mtime":1610539514365,"results":"51","hashOfConfig":"31"},{"size":1120,"mtime":1610376399581,"results":"52","hashOfConfig":"31"},{"size":1431,"mtime":1610529896674,"results":"53","hashOfConfig":"31"},{"size":721,"mtime":1610529896375,"results":"54","hashOfConfig":"31"},{"size":1389,"mtime":1610529896528,"results":"55","hashOfConfig":"31"},{"size":707,"mtime":1610518272862,"results":"56","hashOfConfig":"31"},{"size":3459,"mtime":1610540762677,"results":"57","hashOfConfig":"31"},{"size":765,"mtime":1610534319072,"results":"58","hashOfConfig":"31"},{"size":3622,"mtime":1610540829046,"results":"59","hashOfConfig":"31"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},"3m9re2",{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"85","usedDeprecatedRules":"62"},{"filePath":"86","messages":"87","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"102","messages":"103","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"108","messages":"109","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"110","usedDeprecatedRules":"62"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"115","messages":"116","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\index.js",[],["121","122"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\reportWebVitals.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\App.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\TopicList.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\RegisterForm.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\LoginForm.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\CreateTopicForm.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Topic.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Navbar.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Search.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\ListThreads.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Profile\\Profile.js",["123","124","125"],"import React, { useState, useEffect } from \"react\";\r\nimport './Profile.css';\r\nimport Button from '../Button';\r\nimport ThreadList from '../Threads/PreviewThread'\r\nimport axios from \"axios\";\r\nimport AuthService from '../services/auth.service'\r\nimport { API_URL } from '../services/api_link'\r\nimport { Link } from \"react-router-dom\"\r\n\r\nfunction Profile(props) {\r\n const userId = AuthService.getCurrentUserId();\r\n const profileId = props.match.params.user;\r\n const [user, setUser] = useState({\r\n id:\"\",\r\n name:\"\",\r\n username: \"\"\r\n });\r\n const [usersThreads, setUsersThreads] = useState([]);\r\n\r\n useEffect(() => {\r\n async function getUsersThreads(profileId) {\r\n const allThreads = await axios.get(`${API_URL}/threads`);\r\n const usersThreads = allThreads.data.data.filter(thread => thread.user_id == profileId);\r\n\r\n const getUser = await axios.get(`${API_URL}/users/${profileId}`);\r\n const currentUser = getUser.data.data;\r\n\r\n setUsersThreads(usersThreads);\r\n setUser(currentUser);\r\n }\r\n getUsersThreads(profileId);\r\n }, [userId]);\r\n\r\n\r\n return (\r\n <div>\r\n <div className=\"header\">\r\n <h1><b>Profile</b></h1>\r\n </div>\r\n <div className=\"profile_section\">\r\n <div className=\"userIcon\">\r\n <i class=\"far fa-user-circle icon\"></i>\r\n </div>\r\n <h2><b>{user.username}</b></h2>\r\n </div>\r\n <div className=\"my_threads_section\">\r\n <div className=\"sub_header_my_threads\">\r\n <h3><b>Threads Created by {user.username}</b></h3>\r\n\r\n {userId == profileId && (\r\n <Button text=\"Create Thread\" color=\"orange\" url=\"create/thread\" />\r\n )}\r\n\r\n </div>\r\n <div className=\"list_threads\">\r\n {usersThreads.map((thread) => (\r\n <Link to={`/topic/${thread.topic_name}/${thread.id}`}>\r\n <ThreadList\r\n header={thread.title}\r\n user={thread.username}\r\n points={thread.points}\r\n time={thread.updated_at}\r\n topic={thread.topic_name}\r\n user_id={thread.user_id}>\r\n </ThreadList>\r\n </Link>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default Profile;","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Thread.js",["126","127"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\loggedInService.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\api_link.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth.service.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth-header.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\hooks\\input-hook.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CommentList.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Button.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Post.js",["128","129"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\helpers\\time-util.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\TopThreads.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\PreviewThread.js",["130"],"import './PreviewThread.css';\r\nimport { tConvert, translate } from '../helpers/time-util'\r\n\r\n\r\nexport default function ThreadList(props){\r\n const time = translate(props.time)\r\n return (\r\n <div id=\"threadCard\">\r\n <div id=\"threadCardHeader\">\r\n <h2 id=\"judul\"><b>{props.header}</b></h2>\r\n </div>\r\n <p id=\"topic\">{props.topic}</p>\r\n <div id=\"threadCardContent\">\r\n <p>By {props.user} - {time} - <i class=\"far fa-thumbs-up\"></i> {props.points}</p>\r\n </div>\r\n </div>\r\n )\r\n}","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\RecentThreads.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CreateThread.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormCreateThread.js",["131","132"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\EditThread.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormEditThread.js",["133","134"],{"ruleId":"135","replacedBy":"136"},{"ruleId":"137","replacedBy":"138"},{"ruleId":"139","severity":1,"message":"140","line":23,"column":87,"nodeType":"141","messageId":"142","endLine":23,"endColumn":89},{"ruleId":"143","severity":1,"message":"144","line":32,"column":8,"nodeType":"145","endLine":32,"endColumn":16,"suggestions":"146"},{"ruleId":"139","severity":1,"message":"140","line":50,"column":29,"nodeType":"141","messageId":"142","endLine":50,"endColumn":31},{"ruleId":"139","severity":1,"message":"140","line":53,"column":105,"nodeType":"141","messageId":"142","endLine":53,"endColumn":107},{"ruleId":"139","severity":1,"message":"140","line":66,"column":43,"nodeType":"141","messageId":"142","endLine":66,"endColumn":45},{"ruleId":"147","severity":1,"message":"148","line":3,"column":8,"nodeType":"149","messageId":"150","endLine":3,"endColumn":19},{"ruleId":"139","severity":1,"message":"140","line":77,"column":29,"nodeType":"141","messageId":"142","endLine":77,"endColumn":31},{"ruleId":"147","severity":1,"message":"151","line":2,"column":10,"nodeType":"149","messageId":"150","endLine":2,"endColumn":18},{"ruleId":"147","severity":1,"message":"152","line":37,"column":19,"nodeType":"149","messageId":"150","endLine":37,"endColumn":24},{"ruleId":"139","severity":1,"message":"140","line":37,"column":105,"nodeType":"141","messageId":"142","endLine":37,"endColumn":107},{"ruleId":"143","severity":1,"message":"153","line":35,"column":8,"nodeType":"145","endLine":35,"endColumn":23,"suggestions":"154"},{"ruleId":"139","severity":1,"message":"140","line":49,"column":105,"nodeType":"141","messageId":"142","endLine":49,"endColumn":107},"no-native-reassign",["155"],"no-negated-in-lhs",["156"],"eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'profileId'. Either include it or remove the dependency array.","ArrayExpression",["157"],"no-unused-vars","'AuthService' is defined but never used.","Identifier","unusedVar","'tConvert' is defined but never used.","'topic' is assigned a value but never used.","React Hook useEffect has missing dependencies: 'setBody', 'setTitle', and 'setTopicId'. Either include them or remove the dependency array.",["158"],"no-global-assign","no-unsafe-negation",{"desc":"159","fix":"160"},{"desc":"161","fix":"162"},"Update the dependencies array to be: [profileId, userId]",{"range":"163","text":"164"},"Update the dependencies array to be: [setBody, setTitle, setTopicId, threadIdParam]",{"range":"165","text":"166"},[1144,1152],"[profileId, userId]",[1466,1481],"[setBody, setTitle, setTopicId, threadIdParam]"]
\ No newline at end of file
......@@ -3,3 +3,4 @@
[1218/002045.689:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0103/131625.457:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0103/150109.622:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0112/193848.393:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
......@@ -15,7 +15,7 @@
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "set PORT=3000 && react-scripts start",
"start": "node server/server.js",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
......
......@@ -2,6 +2,7 @@ import React from 'react'
import AuthService from './services/auth.service'
import { useInput } from './hooks/input-hook';
import { useState } from "react";
import { loggedIn } from './services/loggedInService';
import './RegisterForm.css'
const required = value => {
......@@ -29,6 +30,7 @@ export default function RegisterForm(props){
try {
AuthService.register(username, email, password)
if(!loggedIn) throw TypeError('Not valid')
setSuccesful(true)
props.history.push('/')
window.location.reload()
......
......@@ -11,7 +11,7 @@ import AuthService from '../services/auth.service'
export default function Thread(props){
const currentUserId = AuthService.getCurrentUser().id
const currentUserId = AuthService.getCurrentUserId()
const [isUsersThread, setIsUsersThread] = useState(0);
const redirect = () => {
props.history.push(`/topic/${topicParm}`)
......
......@@ -13,19 +13,19 @@ export default function Topic(props){
useEffect(() => {
const fetch = async () => {
const responseThreads = await axios.get(`${API_URL}/threads/`)
const responseTopics = await axios.get(`${API_URL}/topics`)
try {
const responseThreads = await axios.get(`${API_URL}/threads/`)
const responseTopics = await axios.get(`${API_URL}/topics`)
const topic = responseTopics.data.data.find(topic => topic.name === topicParam).id
const threads = responseThreads.data.data.filter(thread => thread.topic_id === topic)
const sortedThreads = threads.sort((a, b) => {
const topic = responseTopics.data.data.find(topic => topic.name === topicParam).id
const threads = responseThreads.data.data.filter(thread => thread.topic_id === topic)
const sortedThreads = threads.sort((a, b) => {
if (a.id < b.id) return 1
if (a.id > b.id) return -1
return 0
})
setThread(sortedThreads)
console.log(threads)
})
setThread(sortedThreads)
} catch(error){}
}
fetch()
}, [topicParam])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment