Notification system in frontend
- Heatmap worker now reports progress - Base for new altitude value - Phones can be marked active
This commit is contained in:
@@ -7,7 +7,7 @@ import { Phone } from "../models/phone/phone.model";
|
||||
export async function GetPhone(req: LivebeatRequest, res: Response) {
|
||||
const phoneId: String = req.params['id'];
|
||||
|
||||
// If none id provided, return all.
|
||||
// If no id provided, return all.
|
||||
if (phoneId === undefined) {
|
||||
const phone = await Phone.find({ user: req.user?._id });
|
||||
res.status(200).send(phone);
|
||||
@@ -48,8 +48,7 @@ export async function PostPhone(req: LivebeatRequest, res: Response) {
|
||||
const phone = await Phone.findOne({ androidId, user: req.user?._id });
|
||||
|
||||
if (phone !== null) {
|
||||
logger.debug("Request to /phone failed because phone already exists.");
|
||||
res.status(409).send();
|
||||
res.status(409).send({ message: "This phone already exists." });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,7 +59,8 @@ export async function PostPhone(req: LivebeatRequest, res: Response) {
|
||||
modelName,
|
||||
operatingSystem,
|
||||
architecture,
|
||||
user: req.user?._id
|
||||
user: req.user?._id,
|
||||
active: false
|
||||
});
|
||||
|
||||
logger.info(`New device (${displayName}) registered for ${req.user?.name}.`)
|
||||
|
||||
Reference in New Issue
Block a user