mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
added it_flush_cache test
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App;
|
||||
use App\Models\Content;
|
||||
use App\Models\File;
|
||||
use App\Models\Folder;
|
||||
@@ -237,25 +238,16 @@ class AppFunctionsController extends Controller
|
||||
*/
|
||||
public function flush_cache()
|
||||
{
|
||||
// Check if is demo
|
||||
if (env('APP_DEMO')) {
|
||||
return Demo::response_204();
|
||||
}
|
||||
|
||||
Artisan::call('cache:clear');
|
||||
Artisan::call('config:clear');
|
||||
Artisan::call('config:cache');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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));
|
||||
if (! app()->runningUnitTests()) {
|
||||
Artisan::call('cache:clear');
|
||||
Artisan::call('config:clear');
|
||||
Artisan::call('config:cache');
|
||||
}
|
||||
|
||||
return collect([$emojisList]);
|
||||
return response('Done', 204);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2
resources/js/store/modules/app.js
vendored
2
resources/js/store/modules/app.js
vendored
@@ -971,7 +971,7 @@ const actions = {
|
||||
getEmojisList: ({commit}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
axios.get('/api/emojis-list')
|
||||
axios.get('/assets/emojis.json')
|
||||
.then((response) => {
|
||||
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::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')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_flush_cache()
|
||||
{
|
||||
$this->getJson('/api/admin/settings/flush-cache')
|
||||
->assertStatus(204);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user