mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-22 17:18:50 +00:00
Update types and fix issue with treating string as a number
Change-type: patch
This commit is contained in:
@ -27,9 +27,16 @@ export function createV2Api(router: Router, applications: ApplicationManager) {
|
||||
res: Response,
|
||||
next: NextFunction,
|
||||
action: any,
|
||||
): Bluebird<void> => {
|
||||
): Resolvable<void> => {
|
||||
const { imageId, serviceName, force } = req.body;
|
||||
const { appId } = req.params;
|
||||
const appId = checkInt(req.params.appId);
|
||||
if (!appId) {
|
||||
res.status(400).json({
|
||||
status: 'failed',
|
||||
message: 'Missing app id',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
return _lockingIfNecessary(appId, { force }, () => {
|
||||
return applications
|
||||
@ -120,7 +127,13 @@ export function createV2Api(router: Router, applications: ApplicationManager) {
|
||||
'/v2/applications/:appId/restart',
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
const { force } = req.body;
|
||||
const { appId } = req.params;
|
||||
const appId = checkInt(req.params.appId);
|
||||
if (!appId) {
|
||||
return res.status(400).json({
|
||||
status: 'failed',
|
||||
message: 'Missing app id',
|
||||
});
|
||||
}
|
||||
|
||||
return doRestart(applications, appId, force)
|
||||
.then(() => {
|
||||
|
@ -86,9 +86,7 @@ export const startConnectivityCheck = _.once(
|
||||
interval: 10 * 1000,
|
||||
},
|
||||
connected => {
|
||||
if (_.isFunction(onChangeCallback)) {
|
||||
onChangeCallback(connected);
|
||||
}
|
||||
onChangeCallback?.(connected);
|
||||
if (connected) {
|
||||
log.info('Internet Connectivity: OK');
|
||||
blink.pattern.stop();
|
||||
|
Reference in New Issue
Block a user