Small UI improvements

This commit is contained in:
Daniel
2022-06-02 01:48:21 +04:30
parent 2e2135976f
commit 28f9d1dcfd
9 changed files with 51 additions and 35 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { nanoid } from 'nanoid'
import '../styles/AddItem.css';
import config from '../config.json';
import config from '../config';
import TagSelection from './TagSelection';
const AddItem = ({onExit, reFetch, tags}) => {
@@ -36,8 +36,8 @@ const AddItem = ({onExit, reFetch, tags}) => {
}
if(name !== '' && isValidHttpUrl(link) && tag !== '') {
const address = config.api.address + ":" + config.api.port;
fetch(address + "/api", {
const ADDRESS = config.API.ADDRESS + ":" + config.API.PORT;
fetch(ADDRESS + "/api", {
// Adding method type
method: "POST",
+3 -3
View File
@@ -1,11 +1,11 @@
import '../styles/List.css';
import config from '../config.json';
import config from '../config';
import LazyLoad from 'react-lazyload';
const List = ({data, reFetch}) => {
function deleteEntity(id) {
const address = config.api.address + ":" + config.api.port;
fetch(address + "/api", {
const ADDRESS = config.API.ADDRESS + ":" + config.API.PORT;
fetch(ADDRESS + "/api", {
// Adding method type
method: "DELETE",