File tree Expand file tree Collapse file tree 3 files changed +4
-18
lines changed
client/src/app/categories Expand file tree Collapse file tree 3 files changed +4
-18
lines changed Original file line number Diff line number Diff line change 7272 * Fetch the category from the server
7373 */
7474 this .setFetching ({ fetching: true })
75- this .$http .get (` categories/${ id} /get ` ).then ((res ) => {
75+ this .$http .get (` categories/${ id} ` ).then ((res ) => {
7676 const { id: _id , name } = res .data .category // http://wesbos.com/destructuring-renaming/
7777 this .category .id = _id
7878 this .category .name = name
9898 }
9999 },
100100 save () {
101- this .$http .post (' categories/create ' , { name: this .category .name }).then (() => {
101+ this .$http .post (' categories' , { name: this .category .name }).then (() => {
102102 /**
103103 * This event will notify the world about
104104 * the category creation. In this case
124124 })
125125 },
126126 update () {
127- this .$http .put (` categories/${ this .category .id } /update ` , this .category ).then (() => {
127+ this .$http .put (` categories/${ this .category .id } ` , this .category ).then (() => {
128128 /**
129129 * This event will notify the world about
130130 * the category creation. In this case
Original file line number Diff line number Diff line change 111111 * Makes the HTTP requesto to the API
112112 */
113113 remove (category ) {
114- this .$http .delete (` categories/${ category .id } /remove ` ).then (() => {
114+ this .$http .delete (` categories/${ category .id } ` ).then (() => {
115115 /**
116116 * On success fetch a new set of Categories
117117 * based on current page number
Original file line number Diff line number Diff line change 1313 ]);
1414 });
1515});
16-
17- // Route::group(['middleware' => ['cors', 'api']], function () {
18- // Route::post('login', ['uses' => 'LoginController@login']);
19- // Route::group(['middleware' => 'jwt.auth'], function () {
20- // Route::group(['prefix' => 'categories'], function () {
21- // Route::get('', ['uses' => 'CategoriesController@all']);
22- // Route::get('{id}/get', ['uses' => 'CategoriesController@get']);
23- // Route::post('create', ['uses' => 'CategoriesController@create']);
24- // Route::put('{id}/update', ['uses' => 'CategoriesController@update']);
25- // Route::delete('{id}/remove', ['uses' => 'CategoriesController@remove']);
26- // });
27- // });
28- // });
29-
You can’t perform that action at this time.
0 commit comments