This commit is contained in:
Daniel
2022-06-04 16:19:41 +04:30
parent e57365fd0c
commit dac172a5c5
5 changed files with 13 additions and 12 deletions
+4 -6
View File
@@ -4,20 +4,18 @@ import '../styles/AddItem.css';
import TagSelection from './TagSelection';
import editItem from '../modules/send';
// deleteEntity(e._id, reFetch)
const EditItem = ({tags, item, onExit, SetLoader, reFetch}) => {
const [name, setName] = useState(item.name);
const [tag, setTag] = useState(item.tag);
function EditItem() {
SetLoader(true)
editItem(name, item.link, tag, reFetch, onExit, SetLoader, "PUT", item._id);
SetLoader(true);
editItem(name, item.link, tag, reFetch, onExit, SetLoader, "PUT", item._id, item.title);
}
function deleteItem() {
SetLoader(true)
deleteEntity(item._id, reFetch, onExit, SetLoader)
SetLoader(true);
deleteEntity(item._id, reFetch, onExit, SetLoader);
}
function SetName(e) {
+1 -1
View File
@@ -42,7 +42,7 @@ const List = ({data, tags, reFetch, SetLoader}) => {
</div>
<div className='etc'>
<ViewArchived className='view-archived' id={e._id} />
<button className="edit-btn" onClick={() => edit(i)}>&#xf044;</button>
<button className="edit-btn" onClick={() => edit(i)}>&#xf303;</button>
</div>
</div>
</LazyLoad>)