mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-14 07:27:01 +03:00
consistent return and sendStatus
This commit is contained in:
@@ -58,10 +58,9 @@ export async function postSegmentShift(req: Request, res: Response): Promise<Res
|
||||
|| !startTime
|
||||
|| !endTime
|
||||
) {
|
||||
res.status(400).json({
|
||||
return res.status(400).json({
|
||||
message: 'Bad Format',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if user is VIP
|
||||
@@ -69,10 +68,9 @@ export async function postSegmentShift(req: Request, res: Response): Promise<Res
|
||||
const userIsVIP = await isUserVIP(userID);
|
||||
|
||||
if (!userIsVIP) {
|
||||
res.status(403).json({
|
||||
return res.status(403).json({
|
||||
message: 'Must be a VIP to perform this action.',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -95,8 +93,8 @@ export async function postSegmentShift(req: Request, res: Response): Promise<Res
|
||||
}
|
||||
} catch (err) {
|
||||
Logger.error(err);
|
||||
res.sendStatus(500);
|
||||
return res.sendStatus(500);
|
||||
}
|
||||
|
||||
res.sendStatus(200);
|
||||
return res.sendStatus(200);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user