Skip to content

Commit

Permalink
Merge branch '2.x-release/v2.2.13' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
themodernpk committed Jun 26, 2024
2 parents f22a4b6 + 4a4ffc4 commit 7445aae
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Config/vaahcms.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$settings = [
'app_name' => 'VaahCMS',
'app_slug' => 'vaahcms',
'version' => '2.2.12',
'version' => '2.2.13',
'php_version_required' => '8.1',
'get_config_version' => false,
'website' => 'https://vaah.dev/cms',
Expand Down
62 changes: 62 additions & 0 deletions Http/Controllers/Api/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use WebReinvent\VaahCms\Libraries\VaahHelper;
use WebReinvent\VaahCms\Models\Module;
use WebReinvent\VaahCms\Models\Setting;
use WebReinvent\VaahCms\Models\Theme;
use WebReinvent\VaahCms\Models\User;


Expand Down Expand Up @@ -60,5 +62,65 @@ public function disableMfa(Request $request,$token)

}
//----------------------------------------------------------
public function publishAssets(Request $request,$slug)
{
try{

$module = Module::slug($slug)->first();

if (!$module) {

$theme = Theme::slug($slug)->first();

if(!$theme){
$response['success'] = false;
$response['errors'][] = "Module/Theme not found.";
return response()->json($response);
}

$message = Theme::copyAssets($theme);

if (!$message) {
$response['success'] = false;
$response['errors'][] = "Something went wrong.";
return response()->json($response);
}

$theme->is_assets_published = 1;
$theme->save();
$response['success'] = true;
$response['messages'][] = "Assets published.";
return response()->json($response);
}

$message = Module::copyAssets($module);

if (!$message) {
$response['success'] = false;
$response['errors'][] = "Something went wrong.";
return response()->json($response);
}

$module->is_assets_published = 1;
$module->save();
$response['success'] = true;
$response['messages'][] = "Assets published.";
} catch (\Exception $e) {
$response = [];
$response['success'] = false;

if(env('APP_DEBUG')){
$response['errors'][] = $e->getMessage();
$response['hint'][] = $e->getTraceAsString();
} else {
$response['errors'][] = trans("vaahcms-general.something_went_wrong");
}
}


return response()->json($response);

}
//----------------------------------------------------------

}
4 changes: 2 additions & 2 deletions Libraries/VaahSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static function createVaahCmsJsonFile($request)
"excerpt"=> "CMS is a framework for creating, managing, and deploying customized content types and fields.",
"author_name"=> "Vaah",
"author_website"=> "https://vaah.dev",
"version"=> "v2.0.1",
"version"=> "v2.0.4",
"is_sample_data_available"=> true,
"import_sample_data"=> false,
],
Expand All @@ -100,7 +100,7 @@ public static function createVaahCmsJsonFile($request)
"github_url"=> "https://github.com/webreinvent/vaahcms-theme-bulma",
"author_name"=> "WebReinvent",
"author_website"=> "https://webreinvent.com",
"version"=> "v0.0.2",
"version"=> "v0.0.6",
"is_sample_data_available"=> true,
"import_sample_data"=> true,
]
Expand Down
6 changes: 4 additions & 2 deletions Routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function () {
//------------------------------------------------
Route::any( '/disable/mfa/{api_token}', 'PublicController@disableMfa' )
->name( 'vh.backend.disable.mfa' );
//------------------------------------------------
Route::any( '/publish/assets/{slug}', 'PublicController@publishAssets' )
->name( 'vh.backend.publish.assets' );

});

Route::group(
Expand Down Expand Up @@ -159,5 +163,3 @@ function () {
Route::any( '/{column}/{value}/delete', 'TaxonomyTypesController@delete' );
});
});


2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webreinvent/vaahcms",
"version": "2.2.12",
"version": "2.2.13",
"description": "VaahCMS is a laravel based open-source web application development platform shipped with headless content management system.",
"keywords": ["vaahcms", "headless", "hmvc", "laravel", "cms", "vue", "pinia"],
"homepage": "https://webreinvent.com",
Expand Down

0 comments on commit 7445aae

Please sign in to comment.