How to define Mongoose Schema for delete method
I am not able to delete items of a list of MongoDB. Unfortunately, when axios.delete method is called in ExpensesListItem.tsx , the item of MongoDB list is not deleted (no error message gets printed to the console). What is wrong with the code (maybe mongoose schema)? ExpensesListItem.tsx import React from "react"; import { IconButton, ListItem, ListItemSecondaryAction, ListItemText } from "@material-ui/core"; import DeleteIcon from '@material-ui/icons/Delete'; import { ExpenseAndAmountObject } from '../ExpenseAndAmountObject'; import axios from 'axios'; interface Props { expenseTitle: string; expenseAmount: string; currencySymbol: string; item: ExpenseAndAmountObject; expenseAndAmountList: Array<ExpenseAndAmountObject>; setExpenseAndAmountList: (value: Array<ExpenseAndAmountObject>) => void; } const ExpensesListItem: React.FC<Props> = ( { expenseTitle, expenseAmount, ...