Skip to content

Commit adba59e

Browse files
committed
update categories urls on the client
1 parent 86f7ecf commit adba59e

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

client/src/app/categories/form.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
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
@@ -98,7 +98,7 @@
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
@@ -124,7 +124,7 @@
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

client/src/app/categories/main.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
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

webservice/routes/api.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,3 @@
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-

0 commit comments

Comments
 (0)