In Nest js I need to write an endpoint which makes a new "rent", is this a valid code?
For a school project I need to make a backend app. I use mysql database with two tables, one for products and one for rent information. @Post(‘:id/rent’) async rent(@Param(‘id’) id: number){ const carRepo= this.dataSource.getRepository(Car); const rentalRepo = this.dataSource.getRepository(Rental); const rental= new Rental; rental.start_date= new Date(); rental.end_date=new Date(); rental.end_date.setDate(rental.start_date.getDate() + 7) const car = await carRepo.findOneBy({id});… Read More In Nest js I need to write an endpoint which makes a new "rent", is this a valid code?