forked from projects/fipamo
ro
ea9dbf025e
the first part of the setting API has been restored, with the methods sync, publish and nav-sync restored to working order under the new API pattern. Documentation for the API will be completed after the upgrade is complete. There was also a script error when trying to edit a page from the link menu on the dashboard, so that has been fixed as well
47 lines
1.9 KiB
PHP
47 lines
1.9 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Http\Controllers\API\PageAPIController;
|
|
use App\Http\Controllers\API\FileUploadAPIController;
|
|
use App\Http\Controllers\API\SettingsAPIController;
|
|
use App\Http\Controllers\API\InitAPIController;
|
|
use App\Http\Controllers\API\MailAPIController;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register API routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
| be assigned to the "api" middleware group. Make something great!
|
|
|
|
|
*/
|
|
|
|
//handle page editing actions
|
|
Route::group(['prefix' => '/admin/page', 'middleware' => 'validate.key'], function () {
|
|
Route::put("/update", [PageAPIController::class, 'update']);
|
|
Route::post("/create", [PageAPIController::class, 'create']);
|
|
Route::delete("/delete", [PageAPIController::class, 'delete']);
|
|
});
|
|
|
|
//settings
|
|
Route::group(['prefix' => '/admin/settings', 'middleware' => 'validate.key'], function () {
|
|
Route::put("/publish", [SettingsAPIController::class, 'publish']);
|
|
Route::put("/sync", [SettingsAPIController::class, 'sync']);
|
|
Route::put("/nav-sync", [SettingsAPIController::class, 'navSync']);
|
|
});
|
|
//backups
|
|
Route::group(['prefix' => '/v1/backup', 'middleware' => 'validate.key'], function () {
|
|
Route::put("/create", [SettingsAPIController::class, 'createBackup']);
|
|
Route::get("/content-download", [SettingsAPIController::class, 'downloadBackup']);
|
|
Route::get("/files-download", [SettingsAPIController::class, 'downloadBackup']);
|
|
});
|
|
|
|
//other
|
|
Route::group(['prefix' => '/v1', 'middleware' => 'validate.key'], function () {
|
|
Route::post("/files", [FileUploadAPIController::class, 'upload']);
|
|
Route::post("/reset", [InitAPIController::class, 'setupReset']);
|
|
Route::post("/mailer", [MailAPIController::class, 'sendNotify']);
|
|
});
|