mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-24 16:51:25 -05:00
Use a post route for metadata so we can request paths that are more than one layer deep
This commit is contained in:
parent
c2e59f2e32
commit
2d8fc06dae
3 changed files with 7 additions and 7 deletions
|
@ -11,16 +11,16 @@ use Illuminate\Http\Request;
|
||||||
|
|
||||||
class ApiController extends Controller {
|
class ApiController extends Controller {
|
||||||
|
|
||||||
public function getMeta($path = null)
|
|
||||||
{
|
|
||||||
return Meta::getData($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlogEntries()
|
public function getBlogEntries()
|
||||||
{
|
{
|
||||||
return Blog::getBlogEntries();
|
return Blog::getBlogEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function postMeta()
|
||||||
|
{
|
||||||
|
return Meta::getData(request()->path);
|
||||||
|
}
|
||||||
|
|
||||||
public function postContactSubmit(Request $request)
|
public function postContactSubmit(Request $request)
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
|
|
|
@ -60,7 +60,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchMetadata() {
|
fetchMetadata() {
|
||||||
this.$http.get(`/api/meta${this.$route.path}${env.apiToken}`).then((response) => {
|
this.$http.post(`/api/meta${env.apiToken}`, { path: this.$route.path }).then((response) => {
|
||||||
this.updateMetadata(response.data);
|
this.updateMetadata(response.data);
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log("error fetching metadata");
|
console.log("error fetching metadata");
|
||||||
|
|
|
@ -10,7 +10,6 @@ use Illuminate\Support\Facades\Route;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Route::get('/blog-entries', 'App\Http\Controllers\ApiController@getBlogEntries');
|
Route::get('/blog-entries', 'App\Http\Controllers\ApiController@getBlogEntries');
|
||||||
Route::get('/meta/{path?}', 'App\Http\Controllers\ApiController@getMeta');
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -18,5 +17,6 @@ Route::get('/meta/{path?}', 'App\Http\Controllers\ApiController@getMeta');
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Route::post('/meta', 'App\Http\Controllers\ApiController@postMeta');
|
||||||
Route::post('/contact-submit', 'App\Http\Controllers\ApiController@postContactSubmit');
|
Route::post('/contact-submit', 'App\Http\Controllers\ApiController@postContactSubmit');
|
||||||
Route::post('/subscription-submit', 'App\Http\Controllers\ApiController@postSubscriptionSubmit');
|
Route::post('/subscription-submit', 'App\Http\Controllers\ApiController@postSubscriptionSubmit');
|
||||||
|
|
Loading…
Reference in a new issue