Tweaked the contents of env variables, read more
NEWS_URI and AUTH_URI had the end of their routes lopped off, so I could reference /admin using either one of them.
This commit is contained in:
@@ -33,7 +33,7 @@ const DeleteAccount = props => {
|
||||
|
||||
const handleSubmit = async (password, authTokens) => {
|
||||
//schedule a deletion
|
||||
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/deletion`, {
|
||||
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/account`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -49,7 +49,7 @@ const handleSubmit = async (password, authTokens) => {
|
||||
}
|
||||
|
||||
//force a logout
|
||||
const result2 = await authTokens.tokenFetch(`${process.env.AUTH_URI}/logout`, {
|
||||
const result2 = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/logout`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
|
||||
@@ -31,7 +31,7 @@ const Member = () => {
|
||||
|
||||
{ /* Logout button logs you out of the server too */ }
|
||||
<Link to='/' onClick={async () => {
|
||||
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/logout`, { //NOTE: this gets overwritten as a bugfix
|
||||
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/logout`, { //NOTE: this gets overwritten as a bugfix
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -18,7 +18,7 @@ const NewsEditor = props => {
|
||||
|
||||
//run once
|
||||
useEffect(async () => {
|
||||
const result = await fetch(`${process.env.NEWS_URI}/metadata?limit=999`, {
|
||||
const result = await fetch(`${process.env.NEWS_URI}/news/metadata?limit=999`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -46,7 +46,7 @@ const NewsEditor = props => {
|
||||
//fetch this article
|
||||
const index = values[0].value;
|
||||
|
||||
const result = await fetch(`${process.env.NEWS_URI}/archive/${index}`, {
|
||||
const result = await fetch(`${process.env.NEWS_URI}/news/archive/${index}`, {
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
}
|
||||
@@ -119,7 +119,7 @@ const handleSubmit = async (title, author, body, index, tokenFetch) => {
|
||||
body = body.trim();
|
||||
|
||||
//fetch POST json data
|
||||
const result = await tokenFetch(`${process.env.NEWS_URI}/${index}`, {
|
||||
const result = await tokenFetch(`${process.env.NEWS_URI}/news/${index}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -143,7 +143,7 @@ const handleDelete = async (index, tokenFetch) => {
|
||||
const conf = confirm('Are you sure you want to delete this article?');
|
||||
|
||||
if (conf) {
|
||||
const result = await tokenFetch(`${process.env.NEWS_URI}/${index}`, {
|
||||
const result = await tokenFetch(`${process.env.NEWS_URI}/news/${index}`, {
|
||||
method: 'DELETE'
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ const NewsFeed = props => {
|
||||
const [articles, setArticles] = useState([]);
|
||||
|
||||
useEffect(async () => {
|
||||
const result = await fetch(props.uri, {
|
||||
const result = await fetch(`${process.env.NEWS_URI}/news`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -53,7 +53,7 @@ const handleSubmit = async (title, author, body, tokenFetch) => {
|
||||
|
||||
//fetch POST json data
|
||||
const result = await tokenFetch(
|
||||
`${process.env.NEWS_URI}`,
|
||||
`${process.env.NEWS_URI}/news`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -46,7 +46,7 @@ const PrivilegeEditor = props => {
|
||||
};
|
||||
|
||||
const handleSubmit = async (username, privilege, tokenFetch) => {
|
||||
const result = await tokenFetch(`${process.env.AUTH_URI}/account/privilege`, {
|
||||
const result = await tokenFetch(`${process.env.AUTH_URI}/admin/privilege`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user