mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-16 01:34:08 +00:00
Add support for release channels (insider release channel) in Updater
This commit is contained in:
@@ -10,14 +10,21 @@ class AppVersionController extends Controller
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$version = Setting::getSetting('version');
|
||||
|
||||
$channel = Setting::getSetting('updater_channel');
|
||||
if (is_null($channel)) {
|
||||
$channel = 'stable';
|
||||
Setting::setSetting('updater_channel', 'stable'); // default.
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'version' => $version,
|
||||
'channel' => $channel,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@ class CheckVersionController extends Controller
|
||||
|
||||
set_time_limit(600); // 10 minutes
|
||||
|
||||
$json = Updater::checkForUpdate(Setting::getSetting('version'));
|
||||
$channel = $request->get('channel', 'stable');
|
||||
$response = Updater::checkForUpdate(Setting::getSetting('version'), $channel);
|
||||
|
||||
return response()->json($json);
|
||||
return response()->json($response);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user