// lets create the city!
await cityRepo.create(acct.id);
- return `<p>You are all signed up! You can go ahead and log in</p>`;
+ return `<div class="alert success">You are all signed up! You can go ahead and log in</div>`;
});
server.post<{body: {username: string, password: string}}, void>('/login', async (req, raw, res) => {
building_type: string
}
}, string>('/cost/construction', async req => {
- const amount = parseInt(req.body.amount, 10);
+ const amount = parseInt(req.body.amount.trim(), 10);
+ console.log('checking amount', amount);
+
+ if(isNaN(amount) || amount < 1) {
+ return '';
+ }
const building = await cityRepo.buildingRepository.findBySlug(req.body.building_type);
if(!building) {