Skip to content

Commit

Permalink
udate for validity date
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinovpankaj committed Feb 7, 2024
1 parent 9e6f66e commit 5e675d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions routes/tenants-endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ router.route('/add')
try{
var errResponse;
// Get user input
var { name,companyDescription, website,allowedDiskSpace,allowedUsersCount,expenses} = req.body;
var { name,companyDescription, website,allowedDiskSpace,allowedUsersCount,expenses,endDate} = req.body;

// Validate user input
if (name===undefined) {
Expand All @@ -27,13 +27,13 @@ try{
return;
}
var registrationDate= (new Date(Date.now())).toISOString();
var endDate = registrationDate.setDate(registrationDate.getDate()+10) ;
//var endDate = registrationDate.setDate(registrationDate.getDate()+10) ;
var newTenant = {
"name":name,
"registrationDate":registrationDate,
"companyDescription":companyDescription,
"website":website,
"endDate":endDate.toISOString(),
"endDate":endDate,
"allowedDiskSpace":allowedDiskSpace===undefined?10:allowedDiskSpace,
"allowedUsersCount": allowedUsersCount===undefined?5:allowedUsersCount,
"expenses": expenses===undefined?1000:expenses,
Expand Down

0 comments on commit 5e675d1

Please sign in to comment.