You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
351 B

import {Request, Response} from 'express';
import {COURSES} from "./db-data";
export function deleteCourse(req: Request, res: Response) {
console.log("Deleting course ...");
const id = req.params["id"];
const course = COURSES[id];
delete COURSES[id];
setTimeout(() => {
res.status(200).json({id});
}, 2000);
}