Reformat code
This commit is contained in:
parent
137428ffa7
commit
123684da13
|
@ -35,7 +35,7 @@ betterzonRouter.use('/crawlingstatus', crawlingstatusRouter);
|
|||
betterzonRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('Pluto Development Betterzon API Endpoint');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -25,7 +25,7 @@ categoriesRouter.get('/', async (req: Request, res: Response) => {
|
|||
const categories: Categories = await CategoryService.findAll();
|
||||
|
||||
res.status(200).send(categories);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ categoriesRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
const category: Category = await CategoryService.find(id);
|
||||
|
||||
res.status(200).send(category);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ categoriesRouter.get('/search/:term', async (req: Request, res: Response) => {
|
|||
const categories: Categories = await CategoryService.findBySearchTerm(term);
|
||||
|
||||
res.status(200).send(categories);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import * as ContactPersonService from './contact_persons.service';
|
|||
import {Contact_Person} from './contact_person.interface';
|
||||
import {Contact_Persons} from './contact_persons.interface';
|
||||
import * as UserService from '../users/users.service';
|
||||
import * as PriceService from '../prices/prices.service';
|
||||
|
||||
|
||||
/**
|
||||
|
@ -27,7 +26,7 @@ contactpersonsRouter.get('/', async (req: Request, res: Response) => {
|
|||
const contacts: Contact_Persons = await ContactPersonService.findAll();
|
||||
|
||||
res.status(200).send(contacts);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -46,7 +45,7 @@ contactpersonsRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
const contact: Contact_Person = await ContactPersonService.find(id);
|
||||
|
||||
res.status(200).send(contact);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -65,7 +64,7 @@ contactpersonsRouter.get('/byvendor/:id', async (req: Request, res: Response) =>
|
|||
const contacts: Contact_Persons = await ContactPersonService.findByVendor(id);
|
||||
|
||||
res.status(200).send(contacts);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -95,7 +94,7 @@ contactpersonsRouter.post('/', async (req: Request, res: Response) => {
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -126,7 +125,7 @@ contactpersonsRouter.put('/:id', async (req: Request, res: Response) => {
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
import express, {Request, Response} from 'express';
|
||||
import * as CrawlingStatusService from './crawling_status.service';
|
||||
import {Crawling_Status} from './crawling_status.interface';
|
||||
import {Crawling_Statuses} from './crawling_statuses.interface';
|
||||
import * as UserService from '../users/users.service';
|
||||
|
||||
|
||||
|
@ -37,7 +36,7 @@ crawlingstatusRouter.get('/', async (req: Request, res: Response) => {
|
|||
const status: Crawling_Status = await CrawlingStatusService.getCurrent();
|
||||
|
||||
res.status(200).send(status);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
import express, {Request, Response} from 'express';
|
||||
import * as FavoriteShopsService from './favoriteshops.service';
|
||||
import {FavoriteShop} from './favoriteshop.interface';
|
||||
import {FavoriteShops} from './favoriteshops.interface';
|
||||
import * as UserService from '../users/users.service';
|
||||
|
||||
|
||||
|
@ -31,7 +29,7 @@ favoriteshopsRouter.get('/', async (req: Request, res: Response) => {
|
|||
const priceAlarms = await FavoriteShopsService.getFavoriteShops(user.user_id);
|
||||
|
||||
res.status(200).send(priceAlarms);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -65,7 +63,7 @@ favoriteshopsRouter.post('/', async (req: Request, res: Response) => {
|
|||
res.status(500).send(JSON.stringify({success: false}));
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -99,7 +97,7 @@ favoriteshopsRouter.delete('/:id', async (req: Request, res: Response) => {
|
|||
res.status(500).send(JSON.stringify({success: false}));
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ manufacturersRouter.get('/', async (req: Request, res: Response) => {
|
|||
const manufacturers: Manufacturers = await ManufacturerService.findAll();
|
||||
|
||||
res.status(200).send(manufacturers);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ manufacturersRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
const manufacturer: Manufacturer = await ManufacturerService.find(id);
|
||||
|
||||
res.status(200).send(manufacturer);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ manufacturersRouter.get('/search/:term', async (req: Request, res: Response) =>
|
|||
const manufacturer: Manufacturers = await ManufacturerService.findBySearchTerm(term);
|
||||
|
||||
res.status(200).send(manufacturer);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
import express, {Request, Response} from 'express';
|
||||
import * as PriceAlarmsService from './pricealarms.service';
|
||||
import {PriceAlarm} from './pricealarm.interface';
|
||||
import {PriceAlarms} from './pricealarms.interface';
|
||||
import * as UserService from '../users/users.service';
|
||||
|
||||
|
||||
|
@ -31,7 +29,7 @@ pricealarmsRouter.get('/', async (req: Request, res: Response) => {
|
|||
const priceAlarms = await PriceAlarmsService.getPriceAlarms(user.user_id);
|
||||
|
||||
res.status(200).send(priceAlarms);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -66,7 +64,7 @@ pricealarmsRouter.post('/', async (req: Request, res: Response) => {
|
|||
res.status(500).send(JSON.stringify({success: false}));
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ pricealarmsRouter.put('/', async (req: Request, res: Response) => {
|
|||
res.status(500).send(JSON.stringify({success: false}));
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -127,7 +125,7 @@ pricealarmsRouter.delete('/:id', async (req, res) => {
|
|||
res.status(500).send(JSON.stringify({success: false}));
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -30,16 +30,16 @@ pricesRouter.get('/', async (req: Request, res: Response) => {
|
|||
|
||||
if (product) {
|
||||
if (vendor) {
|
||||
prices = await PriceService.findByVendor(<string> product, <string> vendor, <string> type);
|
||||
prices = await PriceService.findByVendor(<string>product, <string>vendor, <string>type);
|
||||
} else {
|
||||
prices = await PriceService.findByType(<string> product, <string> type);
|
||||
prices = await PriceService.findByType(<string>product, <string>type);
|
||||
}
|
||||
} else {
|
||||
prices = await PriceService.findAll();
|
||||
}
|
||||
|
||||
res.status(200).send(prices);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ pricesRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
const price: Price = await PriceService.find(id);
|
||||
|
||||
res.status(200).send(price);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ pricesRouter.get('/bestDeals/:amount', async (req: Request, res: Response) => {
|
|||
const prices: Prices = await PriceService.getBestDeals(amount);
|
||||
|
||||
res.status(200).send(prices);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ pricesRouter.get('/byProduct/list/:ids', async (req: Request, res: Response) =>
|
|||
const prices: Prices = await PriceService.findListByProducts(productIds);
|
||||
|
||||
res.status(200).send(prices);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ pricesRouter.post('/', async (req: Request, res: Response) => {
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ productsRouter.get('/', async (req: Request, res: Response) => {
|
|||
const products: Products = await ProductService.findAll();
|
||||
|
||||
res.status(200).send(products);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ productsRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
const product: Product = await ProductService.find(id);
|
||||
|
||||
res.status(200).send(product);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ productsRouter.get('/search/:term', async (req: Request, res: Response) => {
|
|||
const products: Products = await ProductService.findBySearchTerm(term);
|
||||
|
||||
res.status(200).send(products);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ productsRouter.get('/list/:ids', async (req: Request, res: Response) => {
|
|||
const products: Products = await ProductService.findList(ids);
|
||||
|
||||
res.status(200).send(products);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ productsRouter.get('/vendor/:id', async (req: Request, res: Response) => {
|
|||
const products: Products = await ProductService.findByVendor(id);
|
||||
|
||||
res.status(200).send(products);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ productsRouter.post('/', async (req: Request, res: Response) => {
|
|||
} else {
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
import express, {Request, Response} from 'express';
|
||||
import * as UserService from './users.service';
|
||||
import {User} from './user.interface';
|
||||
import {Users} from './users.interface';
|
||||
import {Session} from './session.interface';
|
||||
|
||||
|
||||
|
@ -51,7 +50,7 @@ usersRouter.post('/register', async (req: Request, res: Response) => {
|
|||
session_id: session.session_id,
|
||||
session_key: session.session_key
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -84,7 +83,7 @@ usersRouter.post('/login', async (req: Request, res: Response) => {
|
|||
session_id: session.session_id,
|
||||
session_key: session.session_key
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -97,7 +96,7 @@ usersRouter.post('/checkSessionValid', async (req: Request, res: Response) => {
|
|||
const session_id = req.body.session_id;
|
||||
const session_key = req.body.session_key;
|
||||
|
||||
if(!session_id || !session_key) {
|
||||
if (!session_id || !session_key) {
|
||||
// Error logging in, probably wrong username / password
|
||||
res.status(401).send(JSON.stringify({messages: ['No session detected'], codes: [5]}));
|
||||
return;
|
||||
|
@ -114,7 +113,7 @@ usersRouter.post('/checkSessionValid', async (req: Request, res: Response) => {
|
|||
|
||||
// Send the session details back to the user
|
||||
res.status(200).send(user);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
14
src/models/betterzon/vendors/vendors.router.ts
vendored
14
src/models/betterzon/vendors/vendors.router.ts
vendored
|
@ -26,7 +26,7 @@ vendorsRouter.get('/', async (req: Request, res: Response) => {
|
|||
const vendors: Vendors = await VendorService.findAll();
|
||||
|
||||
res.status(200).send(vendors);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ vendorsRouter.get('/managed', async (req: Request, res: Response) => {
|
|||
const vendors = await VendorService.getManagedShops(user.user_id);
|
||||
|
||||
res.status(200).send(vendors);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ vendorsRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
const vendor: Vendor = await VendorService.find(id);
|
||||
|
||||
res.status(200).send(vendor);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ vendorsRouter.get('/search/:term', async (req: Request, res: Response) => {
|
|||
const vendors: Vendors = await VendorService.findBySearchTerm(term);
|
||||
|
||||
res.status(200).send(vendors);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ vendorsRouter.put('/manage/deactivatelisting', async (req: Request, res: Respons
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ vendorsRouter.put('/manage/shop/deactivate/:id', async (req: Request, res: Respo
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ vendorsRouter.put('/manage/shop/activate/:id', async (req: Request, res: Respons
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ crrRouter.use('/ratings', routeRatingsRouter);
|
|||
crrRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('Pluto Development Climbing Route Rating API Endpoint');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -55,7 +55,7 @@ climbingGymRouter.get('/', async (req: Request, res: Response) => {
|
|||
const gyms: ClimbingGym[] = await GymService.findAll();
|
||||
|
||||
res.status(200).send(gyms);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -140,7 +140,7 @@ climbingGymRouter.post('/', async (req: Request, res: Response) => {
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -59,7 +59,7 @@ climbingRoutesRouter.get('/', async (req: Request, res: Response) => {
|
|||
const routes: ClimbingRoute[] = await RouteService.findAll();
|
||||
|
||||
res.status(200).send(routes);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -126,7 +126,7 @@ climbingRoutesRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
const route: ClimbingRoute = await RouteService.findById(route_id);
|
||||
|
||||
res.status(200).send(route);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -214,7 +214,7 @@ climbingRoutesRouter.post('/', async (req: Request, res: Response) => {
|
|||
let route_id = await RouteService.createRoute(gym_id, name, difficulty);
|
||||
|
||||
res.status(201).send({'route_id': route_id});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -59,7 +59,7 @@ routeCommentsRouter.get('/by/route/:id', async (req: Request, res: Response) =>
|
|||
const comments: RouteComment[] = await CommentService.findByRoute(route_id);
|
||||
|
||||
res.status(200).send(comments);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -143,7 +143,7 @@ routeCommentsRouter.post('/', async (req: Request, res: Response) => {
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -44,7 +44,7 @@ routeRatingsRouter.get('/by/route/:id', async (req: Request, res: Response) => {
|
|||
let rating = await RatingService.getStarsForRoute(route_id);
|
||||
|
||||
res.status(200).send({'rating': rating});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -128,7 +128,7 @@ routeRatingsRouter.post('/', async (req: Request, res: Response) => {
|
|||
} else {
|
||||
res.status(500).send({});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -18,7 +18,7 @@ dhbwRaPlaChangesRouter.get('/', async (req: Request, res: Response) => {
|
|||
let changes = await ChangeService.getChanges('TINF19B4', week);
|
||||
|
||||
res.status(200).send(changes);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -36,7 +36,7 @@ dhbwRaPlaChangesRouter.get('/:id', async (req: Request, res: Response) => {
|
|||
let changes = await ChangeService.getEventById('TINF19B4', id);
|
||||
|
||||
res.status(200).send(changes);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -17,7 +17,7 @@ dhbwServiceRouter.use('/generalInfo', generalInfoRouter);
|
|||
dhbwServiceRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('Pluto Development DHBW Service App API Endpoint');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -13,7 +13,7 @@ export const generalInfoRouter = express.Router();
|
|||
generalInfoRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('GET generalInfo v2.1');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -27,7 +27,7 @@ generalInfoRouter.get('/', async (req: Request, res: Response) => {
|
|||
generalInfoRouter.post('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('POST generalInfo v2.1');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -29,7 +29,7 @@ partyPlanerRouter.use('/user', userRouter);
|
|||
partyPlanerRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('Pluto Development PartyPlaner API Endpoint V2');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -39,7 +39,7 @@ eventRouter.get('/:isDevCall', async (req: Request, res: Response) => {
|
|||
let data = await EventService.getEventData(useDev, userId);
|
||||
|
||||
res.status(200).send(data);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -38,7 +38,7 @@ friendshipRouter.get('/:isDevCall', async (req: Request, res: Response) => {
|
|||
let data = await FriendshipService.getFriendshipData(useDev, userId);
|
||||
|
||||
res.status(200).send(data);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -38,7 +38,7 @@ inviteRouter.get('/:isDevCall', async (req: Request, res: Response) => {
|
|||
let data = await InviteService.getInvitesData(useDev, userId);
|
||||
|
||||
res.status(200).send(data);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -58,7 +58,7 @@ loginRouter.post('/:isDevCall', async (req: Request, res: Response) => {
|
|||
let session = await UserService.loginUser(useDev, username, email, password, userIP, deviceInfo);
|
||||
|
||||
res.status(200).send(session);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -77,7 +77,7 @@ registerRouter.post('/:isDevCall', async (req: Request, res: Response) => {
|
|||
let session = await UserService.registerUser(useDev, username, email, firstName, lastName, password, userIP, deviceInfo);
|
||||
|
||||
res.status(201).send(session);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -38,7 +38,7 @@ sessionRouter.get('/:isDevCall', async (req: Request, res: Response) => {
|
|||
let data = await SessionService.getSessionData(useDev, userId);
|
||||
|
||||
res.status(200).send(data);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -37,7 +37,7 @@ userRouter.get('/:isDevCall', async (req: Request, res: Response) => {
|
|||
let data = await UserService.getUserData(useDev, userId);
|
||||
|
||||
res.status(200).send(data);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -86,7 +86,7 @@ raPlaMiddlewareRouter.get('/', async (req: Request, res: Response) => {
|
|||
|
||||
res.set({'Content-Disposition': 'attachment; filename=' + file + '.ics'});
|
||||
res.status(200).send(resultingFile);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -16,7 +16,7 @@ highlightMarkerRouter.use('/addHighlight', addHighlightRouter);
|
|||
highlightMarkerRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('Pluto Development Twitch Highlight Marker API Endpoint');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
|
@ -14,7 +14,7 @@ export const addHighlightRouter = express.Router();
|
|||
addHighlightRouter.get('/', (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('GET endpoint not defined.');
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
@ -45,7 +45,7 @@ addHighlightRouter.post('/', (req: Request, res: Response) => {
|
|||
res.type('application/json');
|
||||
res.status(200).send({'status': 'success', 'description': ''});
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
|
|
Loading…
Reference in New Issue
Block a user