-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 34.2 KB
/
.eslintcache
1
[{"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\index.js":"1","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\reportWebVitals.js":"2","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Footer.jsx":"3","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\App.js":"4","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\screens\\HomeScreen.jsx":"5","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Routes.jsx":"6","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\screens\\MovieScreen.jsx":"7","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\screens\\GameScreen.jsx":"8","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Header2.jsx":"9","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameDetail.jsx":"10","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieDetail.jsx":"11","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\SuccessSignUp.jsx":"12","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\login.jsx":"13","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\SignUP.jsx":"14","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\Game.jsx":"15","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\Movie.jsx":"16","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieRating.jsx":"17","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\context\\UserContext.jsx":"18","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameManage.jsx":"19","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieManage.jsx":"20","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\ChangePassword.jsx":"21","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\UserRoutes.jsx":"22","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\context\\DataContext.jsx":"23","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieNew.jsx":"24","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameNew.jsx":"25","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieEdit.jsx":"26","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameEdit.jsx":"27"},{"size":528,"mtime":1609655407731,"results":"28","hashOfConfig":"29"},{"size":362,"mtime":499162500000,"results":"30","hashOfConfig":"29"},{"size":324,"mtime":1609653356655,"results":"31","hashOfConfig":"29"},{"size":735,"mtime":1609991544806,"results":"32","hashOfConfig":"29"},{"size":1772,"mtime":1609995767970,"results":"33","hashOfConfig":"29"},{"size":2201,"mtime":1609979440564,"results":"34","hashOfConfig":"29"},{"size":2258,"mtime":1609992071597,"results":"35","hashOfConfig":"29"},{"size":2488,"mtime":1609991778611,"results":"36","hashOfConfig":"29"},{"size":4992,"mtime":1609904372077,"results":"37","hashOfConfig":"29"},{"size":1507,"mtime":1609977734376,"results":"38","hashOfConfig":"29"},{"size":1635,"mtime":1609979609319,"results":"39","hashOfConfig":"29"},{"size":1057,"mtime":1609754143063,"results":"40","hashOfConfig":"29"},{"size":2208,"mtime":1609998284926,"results":"41","hashOfConfig":"29"},{"size":3194,"mtime":1609998263235,"results":"42","hashOfConfig":"29"},{"size":709,"mtime":1609754073554,"results":"43","hashOfConfig":"29"},{"size":866,"mtime":1609754093705,"results":"44","hashOfConfig":"29"},{"size":2190,"mtime":1609754096024,"results":"45","hashOfConfig":"29"},{"size":443,"mtime":1609756467592,"results":"46","hashOfConfig":"29"},{"size":8443,"mtime":1609995363823,"results":"47","hashOfConfig":"29"},{"size":7709,"mtime":1609995462294,"results":"48","hashOfConfig":"29"},{"size":2637,"mtime":1609998103504,"results":"49","hashOfConfig":"29"},{"size":511,"mtime":1609849830655,"results":"50","hashOfConfig":"29"},{"size":1071,"mtime":1609938345961,"results":"51","hashOfConfig":"29"},{"size":6098,"mtime":1609998230569,"results":"52","hashOfConfig":"29"},{"size":5342,"mtime":1609998198976,"results":"53","hashOfConfig":"29"},{"size":7683,"mtime":1610062057581,"results":"54","hashOfConfig":"29"},{"size":6871,"mtime":1610062143765,"results":"55","hashOfConfig":"29"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},"gylewc",{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"75","messages":"76","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"77","usedDeprecatedRules":"58"},{"filePath":"78","messages":"79","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"80","usedDeprecatedRules":"58"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"89","messages":"90","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"97","usedDeprecatedRules":"58"},{"filePath":"98","messages":"99","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"100","usedDeprecatedRules":"58"},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"113","messages":"114","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\index.js",[],["115","116"],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\reportWebVitals.js",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Footer.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\App.js",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\screens\\HomeScreen.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Routes.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\screens\\MovieScreen.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\screens\\GameScreen.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Header2.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameDetail.jsx",["117"],"import React, { useState, useEffect } from 'react'\r\nimport { Link } from 'react-router-dom'\r\nimport { Row, Col, Image, ListGroup } from 'react-bootstrap'\r\nimport axios from 'axios'\r\n\r\nconst ProductScreen = ({ match }) => {\r\n const [game, setGame] = useState({})\r\n console.log(match)\r\n useEffect(() => {\r\n const fetchGame = async () => {\r\n \r\n const { data } = await axios.get(`https://backendexample.sanbersy.com/api/data-game/${match.params.id}`)\r\n setGame(data)\r\n console.log(data)\r\n }\r\n\r\n fetchGame()\r\n }, [])\r\n\r\n return (\r\n <>\r\n <Link className='btn btn-light my-3' to='/'>\r\n Go Back\r\n </Link>\r\n <Row>\r\n <Col md={6}>\r\n <Image className=\"ImageDetail\" src={game.image_url} alt={game.name} fluid />\r\n </Col>\r\n <Col md={6}>\r\n <ListGroup variant='flush'>\r\n <ListGroup.Item>\r\n <h3>{game.name}</h3>\r\n </ListGroup.Item>\r\n <ListGroup.Item>\r\n <h4>{game.release}</h4>\r\n </ListGroup.Item>\r\n <ListGroup.Item>Genre: {game.genre}</ListGroup.Item>\r\n <ListGroup.Item>Single Player: {game.singlePlayer === 1 ? `yes` : `no`}</ListGroup.Item>\r\n <ListGroup.Item>Multi Player: {game.multiplayer === 1 ? `yes` : `no`}</ListGroup.Item>\r\n <ListGroup.Item>Platform: {game.platform}</ListGroup.Item>\r\n </ListGroup>\r\n </Col>\r\n \r\n </Row>\r\n\r\n \r\n </>\r\n )\r\n}\r\n\r\nexport default ProductScreen","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieDetail.jsx",["118"],"import React, { useState, useEffect } from 'react'\r\nimport { Link } from 'react-router-dom'\r\nimport { Row, Col, Image, ListGroup } from 'react-bootstrap'\r\nimport axios from 'axios'\r\n\r\nconst ProductScreen = ({ match }) => {\r\n const [movie, setMovie] = useState({})\r\n useEffect(() => {\r\n const fetchMovie = async () => {\r\n \r\n const { data } = await axios.get(`https://backendexample.sanbersy.com/api/data-movie/${match.params.id}`)\r\n setMovie(data)\r\n }\r\n\r\n fetchMovie()\r\n }, [])\r\n\r\n return (\r\n <>\r\n <Link className='btn btn-light my-3' to='/'>\r\n Go Back\r\n </Link>\r\n <Row>\r\n <Col md={6}>\r\n <Image className=\"ImageDetail\" src={movie.image_url} alt={movie.title} fluid />\r\n </Col>\r\n <Col md={6}>\r\n <ListGroup variant='flush'>\r\n <ListGroup.Item>\r\n <h3>{movie.title}</h3>\r\n </ListGroup.Item>\r\n <ListGroup.Item>\r\n <h4>{movie.year}</h4>\r\n </ListGroup.Item>\r\n <ListGroup.Item>Genre: {movie.genre}</ListGroup.Item>\r\n <ListGroup.Item>Rating: {movie.rating}</ListGroup.Item>\r\n <ListGroup.Item>Duration: {movie.duration}</ListGroup.Item>\r\n </ListGroup>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col md={12}>\r\n <ListGroup.Item>\r\n <h3>Description</h3>\r\n {movie.description}\r\n </ListGroup.Item>\r\n <ListGroup.Item>\r\n <h3>Review</h3>\r\n {movie.review}\r\n </ListGroup.Item>\r\n </Col>\r\n </Row>\r\n </>\r\n )\r\n}\r\n\r\nexport default ProductScreen","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\SuccessSignUp.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\login.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\SignUP.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\Game.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\Movie.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieRating.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\context\\UserContext.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameManage.jsx",["119"],"import React, { useContext, useState } from \"react\";\r\nimport { Table, Button, Row,Col} from \"react-bootstrap\";\r\nimport { UserContext } from \"../../context/UserContext\";\r\nimport axios from \"axios\";\r\nimport { DataContext } from \"../../context/DataContext\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nfunction GameTable() {\r\n const [user] = useContext(UserContext)\r\n const { games, setGames } = useContext(DataContext);\r\n const [search, setSearch] = useState(\"\")\r\n const [sortType,setSortType] = useState(true)\r\n\r\n\r\n const handleChangeSearch = (e)=>{\r\n setSearch(e.target.value)\r\n }\r\n\r\nconst submitSearch = async (e) =>{\r\n e.preventDefault()\r\n await axios.get(`https://backendexample.sanbersy.com/api/data-game`)\r\n .then(res => {\r\n let resGames = res.data.map(el=>{ return {\r\n id : el.id,\r\n created_at : el.created_at,\r\n updated_at : el.updated_at,\r\n name : el.name,\r\n genre : el.genre,\r\n singlePlayer : el.singlePlayer,\r\n multiplayer : el.multiplayer,\r\n platform : el.platform,\r\n release : el.release,\r\n image_url : el.image_url\r\n }\r\n })\r\n\r\n let filteredGames = resGames.filter(o => o.name.toLowerCase().includes(search.toLowerCase())\r\n || o.release.toString().toLowerCase().includes(search.toLowerCase())\r\n || o.genre.toLowerCase().includes(search.toLowerCase())\r\n || o.platform.toString().toLowerCase().includes(search.toLowerCase()))\r\n setGames([...filteredGames])\r\n }).catch((err)=>{\r\n alert(JSON.stringify(err.response.data))\r\n })\r\n \r\n }\r\n\r\n\r\n\r\n \r\n const handleDelete = async (e) => {\r\n let ID_GAMES = parseInt(e.target.value);\r\n let updatedData = games.filter((game) => game.id !== ID_GAMES);\r\n let x = window.confirm(\"Are you sure you want to delete?\");\r\n if (x)\r\n {\r\n await axios\r\n .delete(`https://backendexample.sanbersy.com/api/data-game/${ID_GAMES}`,{headers: {\"Authorization\" : `Bearer ${user.token}`}})\r\n .then((res) => {\r\n console.log(res.data);\r\n }).catch((err)=>{\r\n alert(JSON.stringify(err.response.data))\r\n })\r\n\r\n setGames([...updatedData]);}\r\n else\r\n {return alert(\"Delete Canceled\")};\r\n };\r\n\r\n\r\n\r\n\r\n const sortColumn = (field) => {\r\n setSortType(!sortType)\r\n\r\n const sorted = [...games].sort(function(a,b){\r\n switch (field) {\r\n case \"name\":\r\n if (sortType) {\r\n return (a.name.toUpperCase() > b.name.toUpperCase()) ? 1 : ((b.name.toUpperCase() > a.name.toUpperCase()) ? -1 : 0);\r\n }else{\r\n return (a.name.toUpperCase() < b.name.toUpperCase()) ? 1 : ((b.name.toUpperCase() < a.name.toUpperCase()) ? -1 : 0);\r\n }\r\n \r\n case \"genre\":\r\n if (sortType) {\r\n return (a.genre.toUpperCase() > b.genre.toUpperCase()) ? 1 : ((b.genre.toUpperCase() > a.genre.toUpperCase()) ? -1 : 0);\r\n }else{\r\n return (a.genre.toUpperCase() < b.genre.toUpperCase()) ? 1 : ((b.genre.toUpperCase() < a.genre.toUpperCase()) ? -1 : 0);\r\n }\r\n \r\n case \"platform\":\r\n if (sortType) {\r\n return (a.platform.toUpperCase() > b.platform.toUpperCase()) ? 1 : ((b.platform.toUpperCase() > a.platform.toUpperCase()) ? -1 : 0);\r\n }else{\r\n return (a.platform.toUpperCase() < b.platform.toUpperCase()) ? 1 : ((b.platform.toUpperCase() < a.platform.toUpperCase()) ? -1 : 0);\r\n }\r\n \r\n case \"release\":\r\n if (sortType) {\r\n return (a.release.toUpperCase() > b.release.toUpperCase()) ? 1 : ((b.release.toUpperCase() > a.release.toUpperCase()) ? -1 : 0);\r\n }else{\r\n return (a.release.toUpperCase() < b.release.toUpperCase()) ? 1 : ((b.release.toUpperCase() < a.release.toUpperCase()) ? -1 : 0);\r\n }\r\n case \"singlePlayer\":\r\n if (sortType) {\r\n return (a.singlePlayer > b.singlePlayer) ? 1 : ((b.singlePlayer > a.singlePlayer) ? -1 : 0);\r\n }else{\r\n return (a.singlePlayer < b.singlePlayer) ? 1 : ((b.singlePlayer < a.singlePlayer) ? -1 : 0);\r\n }\r\n \r\n case \"multiplayer\":\r\n if (sortType) {\r\n return (a.multiplayer > b.multiplayer) ? 1 : ((b.multiplayer > a.multiplayer) ? -1 : 0);\r\n }else{\r\n return (a.multiplayer < b.multiplayer) ? 1 : ((b.multiplayer < a.multiplayer) ? -1 : 0);\r\n }\r\n \r\n \r\n default:\r\n break;\r\n }\r\n })\r\n\r\n setGames(sorted);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n return (\r\n <>\r\n <Row>\r\n <Col xs={3}>\r\n <Link to='/add/Game'>\r\n <Button variant=\"dark\" size=\"sm\" >Add New Movie</Button></Link>\r\n </Col>\r\n <Col xs={9}>\r\n <div >\r\n <form onSubmit={submitSearch}>\r\n <input type=\"text\" value={search} placeholder=\"Tittle/Genre/Plafrom\" \r\n onChange={handleChangeSearch} style={{width:\"90%\"}}/>\r\n <span> </span>\r\n <Button variant=\"dark\" size=\"sm\" >search</Button>\r\n </form>\r\n </div>\r\n </Col>\r\n </Row>\r\n\r\n <Row>\r\n <Table\r\n striped\r\n bordered\r\n hover\r\n variant=\"dark\"\r\n className=\"mt-3\"\r\n >\r\n <thead>\r\n <tr>\r\n <th>Image</th>\r\n <th onClick={()=>sortColumn(\"name\")}>Titte Game <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"genre\")}>Genre <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"release\")}>Realease <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"platform\")}>Platform <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"singlePlayer\")}>SinglePlayer </th>\r\n <th onClick={()=>sortColumn(\"multiplayer\")}>MultiPlayer </th>\r\n <th>Action</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n { (\r\n games !== null &&\r\n games.map((game) => {\r\n return (\r\n <tr key={game.id}>\r\n <td style={{height:\"150px\" ,width:\"150px\" }}><img alt={game.name} class=\"ImageCard\" src={game.image_url} ></img></td>\r\n <td>{game.name}</td>\r\n <td>{game.genre === null ? \"-\" : game.genre}</td>\r\n <td>{game.release === null ? \"-\" : game.release}</td>\r\n <td>{game.platform === null ? \"-\" : game.platform}</td>\r\n \r\n <td>\r\n {game.singlePlayer === null && \"-\" }\r\n {game.singlePlayer === 1 && \"Yes\" }\r\n {game.singlePlayer === 0 && \"No\" }\r\n </td>\r\n <td>{game.multiplayer === null && \"-\" }\r\n {game.multiplayer === 1 && \"Yes\" }\r\n {game.multiplayer === 0 && \"No\" }\r\n </td>\r\n <td>\r\n <Link to={`/edit/Game/${game.id}`}>\r\n <Button\r\n size=\"sm\"\r\n variant=\"info\"\r\n className=\"mr-2\"\r\n value={game.id}\r\n // onClick={handleEdit}\r\n >\r\n Edit\r\n </Button>\r\n </Link>\r\n <Button\r\n size=\"sm\"\r\n variant=\"danger\"\r\n className=\"del\"\r\n value={game.id}\r\n onClick={handleDelete}\r\n >\r\n Hapus\r\n </Button>\r\n </td>\r\n </tr>\r\n );\r\n })\r\n )}\r\n </tbody>\r\n </Table>\r\n </Row>\r\n \r\n </>\r\n );\r\n}\r\n\r\nexport default GameTable;","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieManage.jsx",["120"],"import React, { useState, useContext } from \"react\";\r\nimport { DataContext } from \"../../context/DataContext\";\r\nimport { UserContext } from \"../../context/UserContext\";\r\nimport { Table, Button, Row,Col} from \"react-bootstrap\";\r\nimport axios from \"axios\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nfunction MovieTable() {\r\n const [user] = useContext(UserContext)\r\n const { movies, setMovies } = useContext(DataContext);\r\n const [search, setSearch] = useState(\"\")\r\n const [sortType,setSortType] = useState(true)\r\n\r\n\r\n const handleChangeSearch = (e)=>{\r\n setSearch(e.target.value)\r\n }\r\n\r\n const submitSearch = async (e) => {\r\n e.preventDefault();\r\n await axios.get(`https://backendexample.sanbersy.com/api/data-movie`)\r\n .then(res => {\r\n let resMovies = res.data.map(el=>{ return {\r\n id: el.id,\r\n created_at: el.created_at,\r\n updated_at: el.updated_at,\r\n title: el.title,\r\n description: el.description,\r\n year: el.year,\r\n duration: el.duration,\r\n genre: el.genre,\r\n rating: el.rating,\r\n image_url: el.image_url\r\n }\r\n })\r\n\r\n let filteredMovies = resMovies.filter(o => o.title.toLowerCase().includes(search.toLowerCase())\r\n || o.year.toString().toLowerCase().includes(search.toLowerCase())\r\n || o.genre.toLowerCase().includes(search.toLowerCase())\r\n || o.rating.toString().toLowerCase().includes(search.toLowerCase()))\r\n\r\n\r\n setMovies([...filteredMovies])\r\n }).catch((err)=>{\r\n alert(JSON.stringify(err.response.data))\r\n })\r\n \r\n}\r\n\r\nconst sortColumn = (field) => {\r\n setSortType(!sortType)\r\n\r\n const sorted = [...movies].sort(function(a,b){\r\n switch (field) {\r\n case \"title\":\r\n if (sortType) {\r\n return (a.title.toUpperCase() > b.title.toUpperCase()) ? 1 : ((b.title.toUpperCase() > a.title.toUpperCase()) ? -1 : 0);\r\n }else{\r\n return (a.title.toUpperCase() < b.title.toUpperCase()) ? 1 : ((b.title.toUpperCase() < a.title.toUpperCase()) ? -1 : 0);\r\n }\r\n \r\n case \"description\":\r\n if (sortType) {\r\n return (a.description.toUpperCase() > b.description.toUpperCase()) ? 1 : ((b.description.toUpperCase() > a.description.toUpperCase()) ? -1 : 0);\r\n }else{\r\n return (a.description.toUpperCase() < b.description.toUpperCase()) ? 1 : ((b.description.toUpperCase() < a.description.toUpperCase()) ? -1 : 0);\r\n }\r\n \r\n case \"year\":\r\n if (sortType) {\r\n return (a.year > b.year) ? 1 : ((b.year > a.year) ? -1 : 0);\r\n }else{\r\n return (a.year < b.year) ? 1 : ((b.year < a.year) ? -1 : 0);\r\n }\r\n \r\n case \"duration\":\r\n if (sortType) {\r\n return (a.duration > b.duration) ? 1 : ((b.duration > a.duration) ? -1 : 0);\r\n }else{\r\n return (a.duration < b.duration) ? 1 : ((b.duration < a.duration) ? -1 : 0);\r\n }\r\n \r\n case \"genre\":\r\n if (sortType) {\r\n return (a.genre.toUpperCase() > b.genre.toUpperCase()) ? 1 : ((b.genre.toUpperCase() > a.genre.toUpperCase()) ? -1 : 0);\r\n }else{\r\n return (a.genre.toUpperCase() < b.genre.toUpperCase()) ? 1 : ((b.genre.toUpperCase() < a.genre.toUpperCase()) ? -1 : 0);\r\n }\r\n \r\n case \"rating\":\r\n if (sortType) {\r\n return (a.rating > b.rating) ? 1 : ((b.rating > a.rating) ? -1 : 0);\r\n }else{\r\n return (a.rating < b.rating) ? 1 : ((b.rating < a.rating) ? -1 : 0);\r\n }\r\n \r\n \r\n default:\r\n break;\r\n }\r\n })\r\n\r\n setMovies(sorted);\r\n }\r\n\r\n\r\n const handleDelete = async (e) => {\r\n let ID_MOVIES = parseInt(e.target.value);\r\n let updatedData = movies.filter((movie) => movie.id !== ID_MOVIES);\r\n\r\n let x = window.confirm(\"Are you sure you want to delete?\");\r\n if (x)\r\n {\r\n await axios\r\n .delete(`https://backendexample.sanbersy.com/api/data-movie/${ID_MOVIES}`,{headers: {\"Authorization\" : `Bearer ${user.token}`}})\r\n .then((res) => {\r\n console.log(res.data);\r\n }).catch((err)=>{\r\n alert(JSON.stringify(err.response.data))\r\n })\r\n \r\n setMovies([...updatedData]);\r\n }\r\n else\r\n {return alert(\"Delete Canceled\")};\r\n \r\n };\r\n\r\n \r\n\r\n\r\n return (\r\n <>\r\n <Row>\r\n <Col xs={3}>\r\n <Link to='/add/Movie'>\r\n <Button variant=\"dark\" size=\"sm\" >Add New Movie</Button></Link>\r\n </Col>\r\n <Col xs={9}>\r\n <form onSubmit={submitSearch}>\r\n <input type=\"text\" value={search} placeholder=\"Tittle/Genre/Year/Rating\" onChange={handleChangeSearch} style={{width:\"90%\"}}/>\r\n <span> </span>\r\n <Button variant=\"dark\" size=\"sm\" >search</Button>\r\n </form>\r\n </Col>\r\n </Row>\r\n \r\n <Row>\r\n <Table\r\n striped\r\n bordered\r\n hover\r\n variant= \"dark\"\r\n className=\"mt-3\"\r\n >\r\n <thead>\r\n <tr>\r\n <th>Poster</th>\r\n <th onClick={()=>sortColumn(\"title\")}>Title <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"year\")}>Year <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"duration\")}>Duration <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"genre\")}>Genre <i class=\"fas fa-sort\"></i></th>\r\n <th onClick={()=>sortColumn(\"rating\")}>Rating <i class=\"fas fa-sort\"></i></th>\r\n <th>Description</th>\r\n <th>Action</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n { (\r\n movies !== null &&\r\n movies.map((movie) => {\r\n return (\r\n <tr key={movie.id}>\r\n <td style={{height:\"150px\" ,width:\"150px\" }}><img alt={movie.title} class=\"ImageCard\" src={movie.image_url} ></img></td>\r\n <td>{movie.title}</td>\r\n <td>{movie.year === null ? \"-\" : movie.year}</td>\r\n <td>{movie.duration === null ? \"-\" : movie.duration}</td>\r\n <td>{movie.genre === null ? \"-\" : movie.genre}</td>\r\n <td>{movie.rating === null ? \"-\" : movie.genre}</td>\r\n <td>\r\n <div style={{overflow:\"hidden\",height:\"150px\" }}>{movie.description}</div>\r\n </td>\r\n <td>\r\n <Link to={`/edit/Movie/${movie.id}`}>\r\n <Button\r\n size=\"sm\"\r\n variant=\"info\"\r\n className=\"mr-2\"\r\n value={movie.id}\r\n // onClick={handleEdit}\r\n >\r\n Edit\r\n </Button>\r\n </Link>\r\n <Button\r\n size=\"sm\"\r\n variant=\"danger\"\r\n className=\"del\"\r\n value={movie.id}\r\n onClick={handleDelete}\r\n >\r\n Hapus\r\n </Button>\r\n </td>\r\n </tr>\r\n );\r\n })\r\n )}\r\n </tbody>\r\n </Table>\r\n </Row>\r\n\r\n \r\n </>\r\n );\r\n}\r\n\r\nexport default MovieTable;","C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\User\\ChangePassword.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\UserRoutes.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\context\\DataContext.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieNew.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameNew.jsx",[],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Movie\\MovieEdit.jsx",["121","122"],"C:\\Users\\user\\github\\sanber\\IM-Sanbercode-Reactjs-Batch-20\\final-project\\src\\components\\Game\\GameEdit.jsx",["123","124"],{"ruleId":"125","replacedBy":"126"},{"ruleId":"127","replacedBy":"128"},{"ruleId":"129","severity":1,"message":"130","line":18,"column":6,"nodeType":"131","endLine":18,"endColumn":8,"suggestions":"132"},{"ruleId":"129","severity":1,"message":"130","line":16,"column":6,"nodeType":"131","endLine":16,"endColumn":8,"suggestions":"133"},{"ruleId":"134","severity":1,"message":"135","line":76,"column":37,"nodeType":"136","messageId":"137","endLine":76,"endColumn":45},{"ruleId":"134","severity":1,"message":"135","line":53,"column":36,"nodeType":"136","messageId":"137","endLine":53,"endColumn":44},{"ruleId":"138","severity":1,"message":"139","line":8,"column":7,"nodeType":"140","messageId":"141","endLine":8,"endColumn":14},{"ruleId":"129","severity":1,"message":"142","line":43,"column":6,"nodeType":"131","endLine":43,"endColumn":8,"suggestions":"143"},{"ruleId":"138","severity":1,"message":"139","line":8,"column":7,"nodeType":"140","messageId":"141","endLine":8,"endColumn":14},{"ruleId":"129","severity":1,"message":"142","line":39,"column":6,"nodeType":"131","endLine":39,"endColumn":8,"suggestions":"144"},"no-native-reassign",["145"],"no-negated-in-lhs",["146"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'match.params.id'. Either include it or remove the dependency array.","ArrayExpression",["147"],["148"],"array-callback-return","Array.prototype.sort() expects a value to be returned at the end of function.","FunctionExpression","expectedAtEnd","no-unused-vars","'history' is assigned a value but never used.","Identifier","unusedVar","React Hook useEffect has missing dependencies: 'input' and 'match.params.id'. Either include them or remove the dependency array. You can also do a functional update 'setInput(i => ...)' if you only need 'input' in the 'setInput' call.",["149"],["150"],"no-global-assign","no-unsafe-negation",{"desc":"151","fix":"152"},{"desc":"151","fix":"153"},{"desc":"154","fix":"155"},{"desc":"154","fix":"156"},"Update the dependencies array to be: [match.params.id]",{"range":"157","text":"158"},{"range":"159","text":"158"},"Update the dependencies array to be: [input, match.params.id]",{"range":"160","text":"161"},{"range":"162","text":"161"},[541,543],"[match.params.id]",[500,502],[1157,1159],"[input, match.params.id]",[1124,1126]]