feat: added controller for new services
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import express, { Request, Response } from "express";
|
||||
import { StatusCodes } from "http-status-codes";
|
||||
import { container } from "tsyringe";
|
||||
import { authenticateHeader } from "../middleware/authentificationMiddleware";
|
||||
import { validateData } from "../middleware/validationMiddleware";
|
||||
import { TtnMessage } from "../models/ttnMessage";
|
||||
import { LocationService } from "../services/locationService";
|
||||
@ -7,8 +9,6 @@ import { LpTtnEndDeviceUplinksService } from "../services/lpTtnEndDeviceUplinksS
|
||||
import { TtnGatewayReceptionService } from "../services/ttnGatewayReceptionService";
|
||||
import { WifiScanService } from "../services/wifiScanService";
|
||||
import { ttnMessageValidator } from "../validation/ttn/ttnMessageValidation";
|
||||
import { authenticateHeader } from "../middleware/authentificationMiddleware";
|
||||
import { StatusCodes } from "http-status-codes";
|
||||
|
||||
const lpTtnEndDeviceUplinksService = container.resolve(
|
||||
LpTtnEndDeviceUplinksService
|
||||
@ -94,9 +94,9 @@ router.post(
|
||||
gnss:
|
||||
gnnsLocation.latitude && gnnsLocation.longitude
|
||||
? {
|
||||
latitude: gnnsLocation.latitude,
|
||||
longitude: gnnsLocation.longitude,
|
||||
}
|
||||
latitude: gnnsLocation.latitude,
|
||||
longitude: gnnsLocation.longitude,
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
};
|
||||
@ -104,7 +104,9 @@ router.post(
|
||||
res.status(StatusCodes.OK).send();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
res.status(StatusCodes.INTERNAL_SERVER_ERROR).json({ error: "Error creating uplink" });
|
||||
res
|
||||
.status(StatusCodes.INTERNAL_SERVER_ERROR)
|
||||
.json({ error: "Error creating uplink" });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user