mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-13 08:45:01 +00:00
added it_flush_cache test
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App;
|
||||||
use App\Models\Content;
|
use App\Models\Content;
|
||||||
use App\Models\File;
|
use App\Models\File;
|
||||||
use App\Models\Folder;
|
use App\Models\Folder;
|
||||||
@@ -237,25 +238,16 @@ class AppFunctionsController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function flush_cache()
|
public function flush_cache()
|
||||||
{
|
{
|
||||||
// Check if is demo
|
|
||||||
if (env('APP_DEMO')) {
|
if (env('APP_DEMO')) {
|
||||||
return Demo::response_204();
|
return Demo::response_204();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! app()->runningUnitTests()) {
|
||||||
Artisan::call('cache:clear');
|
Artisan::call('cache:clear');
|
||||||
Artisan::call('config:clear');
|
Artisan::call('config:clear');
|
||||||
Artisan::call('config:cache');
|
Artisan::call('config:cache');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
return response('Done', 204);
|
||||||
* Get Emojis List from the server
|
|
||||||
*
|
|
||||||
* @return $emojisList
|
|
||||||
*/
|
|
||||||
public function get_emojis_list()
|
|
||||||
{
|
|
||||||
$emojisList = json_decode(file_get_contents(public_path('assets/emojis.json'), true));
|
|
||||||
|
|
||||||
return collect([$emojisList]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"emojisList" :
|
"emojisList": [
|
||||||
[
|
|
||||||
{
|
{
|
||||||
"codes": "1F600",
|
"codes": "1F600",
|
||||||
"char": "😀",
|
"char": "😀",
|
||||||
|
|||||||
Vendored
+1
-1
@@ -971,7 +971,7 @@ const actions = {
|
|||||||
getEmojisList: ({commit}) => {
|
getEmojisList: ({commit}) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
axios.get('/api/emojis-list')
|
axios.get('/assets/emojis.json')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
commit('LOAD_EMOJIS_LIST', response.data[0])
|
commit('LOAD_EMOJIS_LIST', response.data[0])
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,4 @@ Route::group(['middleware' => ['auth:sanctum']], function () {
|
|||||||
Route::post('/files', [EditItemsController::class, 'user_zip_multiple_files']);
|
Route::post('/files', [EditItemsController::class, 'user_zip_multiple_files']);
|
||||||
Route::get('/folder/{unique_id}', [EditItemsController::class, 'user_zip_folder']);
|
Route::get('/folder/{unique_id}', [EditItemsController::class, 'user_zip_folder']);
|
||||||
});
|
});
|
||||||
|
|
||||||
//Get Emojis List
|
|
||||||
Route::get('/emojis-list', [AppFunctionsController::class, 'get_emojis_list']);
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -532,4 +532,13 @@ class AdminTest extends TestCase
|
|||||||
get_setting('app_logo')
|
get_setting('app_logo')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_flush_cache()
|
||||||
|
{
|
||||||
|
$this->getJson('/api/admin/settings/flush-cache')
|
||||||
|
->assertStatus(204);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user