Fakultas Ilmu Komputer UI

Commit cb75a485 authored by Fadhil Pradipta Widyanto's avatar Fadhil Pradipta Widyanto
Browse files

Merge branch 'fadhil' into 'master'

Fadhil

See merge request diskuy!81
parents 4b7a84dd 8aa427cc
<<<<<<< HEAD
[{"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\index.js":"1","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\reportWebVitals.js":"2","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\App.js":"3","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Navbar.js":"4","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Search.js":"5","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\RegisterForm.js":"6","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\TopicList.js":"7","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\ListThreads.js":"8","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\CreateThreadForm.js":"9","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\LoginForm.js":"10","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\CreateTopicForm.js":"11","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Topic.js":"12","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\EditThreadForm.js":"13","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\Thread.js":"14","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Profile\\Profile.js":"15","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\api_link.js":"16","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\loggedInService.js":"17","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\hooks\\input-hook.js":"18","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\auth.service.js":"19","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\auth-header.js":"20","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\CommentList.js":"21","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Button.js":"22","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\Post.js":"23","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\helpers\\time-util.js":"24","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\PreviewThread.js":"25","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\TopThreads.js":"26","C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\RecentThreads.js":"27"},{"size":517,"mtime":1609488248462,"results":"28","hashOfConfig":"29"},{"size":375,"mtime":1609488248463,"results":"30","hashOfConfig":"29"},{"size":1602,"mtime":1610455036231,"results":"31","hashOfConfig":"29"},{"size":2479,"mtime":1610455036233,"results":"32","hashOfConfig":"29"},{"size":1387,"mtime":1610455036235,"results":"33","hashOfConfig":"29"},{"size":3093,"mtime":1610385130750,"results":"34","hashOfConfig":"29"},{"size":992,"mtime":1610272381986,"results":"35","hashOfConfig":"29"},{"size":2275,"mtime":1610455036237,"results":"36","hashOfConfig":"29"},{"size":2602,"mtime":1610454403580,"results":"37","hashOfConfig":"29"},{"size":2449,"mtime":1610271843780,"results":"38","hashOfConfig":"29"},{"size":1110,"mtime":1610270922122,"results":"39","hashOfConfig":"29"},{"size":2007,"mtime":1610455036242,"results":"40","hashOfConfig":"29"},{"size":3026,"mtime":1610454403582,"results":"41","hashOfConfig":"29"},{"size":4460,"mtime":1610455064201,"results":"42","hashOfConfig":"29"},{"size":2112,"mtime":1610455036234,"results":"43","hashOfConfig":"29"},{"size":115,"mtime":1610385143697,"results":"44","hashOfConfig":"29"},{"size":103,"mtime":1610269896166,"results":"45","hashOfConfig":"29"},{"size":374,"mtime":1609493940247,"results":"46","hashOfConfig":"29"},{"size":1011,"mtime":1610385148294,"results":"47","hashOfConfig":"29"},{"size":209,"mtime":1610101522114,"results":"48","hashOfConfig":"29"},{"size":709,"mtime":1610190892393,"results":"49","hashOfConfig":"29"},{"size":310,"mtime":1609674230131,"results":"50","hashOfConfig":"29"},{"size":3202,"mtime":1610454403583,"results":"51","hashOfConfig":"29"},{"size":1120,"mtime":1610190845030,"results":"52","hashOfConfig":"29"},{"size":574,"mtime":1610455036239,"results":"53","hashOfConfig":"29"},{"size":1382,"mtime":1610455036300,"results":"54","hashOfConfig":"29"},{"size":1340,"mtime":1610455036240,"results":"55","hashOfConfig":"29"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"p8ileb",{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"64"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"64"},{"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,"usedDeprecatedRules":"64"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"64"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"83","messages":"84","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"64"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"105","messages":"106","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\index.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\reportWebVitals.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\App.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Navbar.js",[],["111","112"],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Search.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\RegisterForm.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\TopicList.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\ListThreads.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\CreateThreadForm.js",["113","114"],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\LoginForm.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\CreateTopicForm.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Topic.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\EditThreadForm.js",["115","116"],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\Thread.js",["117","118","119"],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Profile\\Profile.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\api_link.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\loggedInService.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\hooks\\input-hook.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\auth.service.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\services\\auth-header.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\CommentList.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Button.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\Post.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\helpers\\time-util.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\PreviewThread.js",["120"],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\TopThreads.js",[],"C:\\Users\\ASUS\\Documents\\pemfung2\\diskuy\\src\\Threads\\RecentThreads.js",[],{"ruleId":"121","replacedBy":"122"},{"ruleId":"123","replacedBy":"124"},{"ruleId":"125","severity":1,"message":"126","line":14,"column":11,"nodeType":"127","messageId":"128","endLine":14,"endColumn":21},{"ruleId":"129","severity":1,"message":"130","line":38,"column":105,"nodeType":"131","messageId":"132","endLine":38,"endColumn":107},{"ruleId":"133","severity":1,"message":"134","line":34,"column":8,"nodeType":"135","endLine":34,"endColumn":23,"suggestions":"136"},{"ruleId":"129","severity":1,"message":"130","line":48,"column":105,"nodeType":"131","messageId":"132","endLine":48,"endColumn":107},{"ruleId":"129","severity":1,"message":"130","line":48,"column":105,"nodeType":"131","messageId":"132","endLine":48,"endColumn":107},{"ruleId":"129","severity":1,"message":"130","line":70,"column":43,"nodeType":"131","messageId":"132","endLine":70,"endColumn":45},{"ruleId":"133","severity":1,"message":"137","line":75,"column":8,"nodeType":"135","endLine":75,"endColumn":36,"suggestions":"138"},{"ruleId":"125","severity":1,"message":"139","line":2,"column":10,"nodeType":"127","messageId":"128","endLine":2,"endColumn":18},"no-native-reassign",["140"],"no-negated-in-lhs",["141"],"no-unused-vars","'topicParam' is assigned a value but never used.","Identifier","unusedVar","eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'setBody', 'setTitle', and 'setTopicId'. Either include them or remove the dependency array.","ArrayExpression",["142"],"React Hook useEffect has a missing dependency: 'currentUserId'. Either include it or remove the dependency array.",["143"],"'tConvert' is defined but never used.","no-global-assign","no-unsafe-negation",{"desc":"144","fix":"145"},{"desc":"146","fix":"147"},"Update the dependencies array to be: [setBody, setTitle, setTopicId, threadIdParam]",{"range":"148","text":"149"},"Update the dependencies array to be: [threadParm, refreshComment, currentUserId]",{"range":"150","text":"151"},[1429,1444],"[setBody, setTitle, setTopicId, threadIdParam]",[2340,2368],"[threadParm, refreshComment, currentUserId]"]
=======
>>>>>>> 4b7a84dd0b449a93cff174410811854d430f8c06
......@@ -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