Skip to content

Commit

Permalink
Updates boughtDate upon checking item
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryan-Dang committed Nov 12, 2022
1 parent 1ab3635 commit 373e21d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/Todo/TodoItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import api from "../../api/api";
import { Server } from "../../utils/config";
import { deleteButton } from "../icons";

const current = new Date();
// const date = `${current.getDate()}/${current.getMonth()+1}/${current.getFullYear()}`;

const TodoItem = ({ item, setStale }) => {
const handleComplete = async (e, item) => {
console.log("Marking Todo as complete");
let data = {
isBought: !item["isBought"],
boughtDate : current
};
try {
console.log(item)
Expand Down

0 comments on commit 373e21d

Please sign in to comment.