Skip to content
This repository was archived by the owner on Apr 12, 2023. It is now read-only.

Commit 66d1850

Browse files
committed
CRUD fix
1 parent c268c1e commit 66d1850

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/components/sets/Comments.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ const Comments = () => {
1111
const [loading, setLoading] = useState(false);
1212
const [body, setBody] = useState("")
1313
const [mode, setMode] = useState("")
14-
let token = 'cf96a9e12b8d7877c8c8647b097cd3db2bdebcad';
14+
let token = '';
1515
const client = new ApolloClient({
1616
uri: 'https://api.github.com/graphql',
17+
1718
request: (operation) => {
1819
operation.setContext({
1920
headers: {
@@ -93,8 +94,7 @@ const Comments = () => {
9394
`
9495
}).then(result => {
9596
console.log(result)
96-
localStorage.setItem('tabNumber', 0)
97-
localStorage.setItem('repoName', '')
97+
localStorage.clear();
9898
window.location.reload();
9999
alert("Created Comment");
100100
})

src/components/sets/Issues.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Issues = () => {
1616
const [body, setBody] = useState("")
1717
const [mode, setMode] = useState("")
1818
let comments = []
19-
let token = 'cf96a9e12b8d7877c8c8647b097cd3db2bdebcad';
19+
let token = '';
2020
const client = new ApolloClient({
2121
uri: 'https://api.github.com/graphql',
2222
request: (operation) => {
@@ -127,8 +127,7 @@ const Issues = () => {
127127
}
128128
`
129129
}).then(result => {
130-
localStorage.setItem('tabNumber', 0)
131-
localStorage.setItem('repoName', '')
130+
localStorage.clear();
132131
window.location.reload();
133132
alert("Created Issue: " + result.data.createIssue.issue.title)
134133
})

src/components/sets/Repos.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React, {useState, useEffect} from 'react';
22
import Pagination from '../Pagination';
33
import {TableHeader, TableBody, Table} from '@patternfly/react-table';
4-
import { css } from '@patternfly/react-styles';
5-
import styles from '@patternfly/react-styles/css/components/Table/table';
64
import Button from 'react-bootstrap/Button';
75
import ApolloClient from 'apollo-boost';
86
import gql from 'graphql-tag';
@@ -13,7 +11,7 @@ const Repos = () => {
1311
const [currentPage, setCurrentPage] = useState(1);
1412
const [reposPerPage, setReposPerPage] = useState(6);
1513
let issues = [];
16-
let token = 'cf96a9e12b8d7877c8c8647b097cd3db2bdebcad';
14+
let token = '';
1715
const client = new ApolloClient({
1816
uri: 'https://api.github.com/graphql',
1917
request: (operation) => {

0 commit comments

Comments
 (0)