Skip to content

Commit

Permalink
Fix Title Preview Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
karakhanyans committed Oct 22, 2020
1 parent d7131d4 commit 3856b48
Show file tree
Hide file tree
Showing 5 changed files with 25,543 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/Controllers/ManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class ManagerController extends Controller

public function __construct(Request $request)
{
if($request->locale){
app()->setLocale($request->locale);
if($request->get('locale')){
app()->setLocale($request->get('locale'));
$this->locale = app()->getLocale();
}
}

/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
Expand Down Expand Up @@ -109,9 +109,10 @@ public function storeData(Request $request)
*/
public function getExampleTitle(Request $request)
{
$route = $request->get('route');
try {
$manager = SeoManagerModel::find($request->id);
$titles = $request->get('title_dynamic');
$manager = SeoManagerModel::find($route['id']);
$titles = $route['title_dynamic'];
$exampleTitle = $this->getDynamicTitle($titles, $manager);
return response()->json(['example_title' => $exampleTitle]);
} catch (\Exception $exception) {
Expand Down
25,526 changes: 25,525 additions & 1 deletion src/assets/js/seo-manager.app.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/vue/components/routes/partials/TitleDynamic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
},
getExampleTitle(locale) {
if (this.route.title_dynamic !== null && this.route.title_dynamic.length > 0) {
this.$http.post(API_URL + '/get-example-title?locale=' + locale, this.route).then(response => {
this.$http.post(API_URL + '/get-example-title?locale=' + locale, {
route: this.route,
_token: CSRF_TOKEN
}).then(response => {
this.example_title = response.data.example_title;
})
}
Expand Down
5 changes: 4 additions & 1 deletion src/vue/components/routes/partials/mappings/TitleMapping.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@
this.getExampleTitle();
},
getExampleTitle() {
this.$http.post(API_URL + '/get-example-title?locale='+this.locale, this.route).then(response => {
this.$http.post(API_URL + '/get-example-title?locale='+this.locale, {
route: this.route,
_token: CSRF_TOKEN
}).then(response => {
this.example_title = response.data.example_title;
})
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@
this.getExampleTitle();
},
getExampleTitle() {
this.$http.post(API_URL + '/get-example-title?locale=' + this.locale, this.route).then(response => {
this.$http.post(API_URL + '/get-example-title?locale=' + this.locale, {
route: this.route,
_token: CSRF_TOKEN
}).then(response => {
this.example_title = response.data.example_title;
})
},
Expand Down

0 comments on commit 3856b48

Please sign in to comment.