File tree Expand file tree Collapse file tree 4 files changed +22
-12
lines changed
Expand file tree Collapse file tree 4 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ export default {
3131<style lang="sass" src="assets/sass/app.scss "></style >
3232
3333<style scoped>
34- .fade-enter-active {
34+ .fade-enter-active , .fade-leave-active {
3535 transition : opacity .5s ease ;
3636 }
37- .fade-enter {
37+ .fade-enter , .fade-leave-active {
3838 opacity : 0 ;
3939 }
4040 </style >
Original file line number Diff line number Diff line change 11
2+ // export const apiUrl = 'http://spa.vedcasts.com.br/api/'
23export const apiUrl = 'http://localhost:8000/api/'
Original file line number Diff line number Diff line change 162162 return this .$route .name === ' categories.new' || this .$route .name === ' categories.edit'
163163 },
164164 },
165+ /**
166+ * Right before navigate out to another route
167+ * clears all event handlers, thus avoiding
168+ * multiple handlers to be set and the annoying
169+ * behaviour of multiple AJAX calls being made.
170+ */
171+ beforeRouteLeave (to , from , next ) {
172+ this .$bus .$off (' navigate' )
173+ this .$bus .$off (' category.created' )
174+ this .$bus .$off (' category.updated' )
175+ jQuery (' body' ).off (' keyup' )
176+ next ()
177+ },
165178 mounted () {
166179 /**
167180 * Listen to pagination navigate event
172185 */
173186 this .$bus .$on (' category.created' , () => this .fetch ())
174187 this .$bus .$on (' category.updated' , () => this .fetch ())
188+
175189 /**
176- * We only fetch data the first time
177- * component is mounted. We can set
178- * up a timer to fetch new data
179- * from time to time
190+ * Fetch data immediately after component is mounted
180191 */
181- if (this .pager .data === undefined ) {
182- this .fetch ()
183- }
192+ this .fetch ()
184193 },
185194 /**
186195 * This hook is called every time DOM
Original file line number Diff line number Diff line change @@ -29,17 +29,17 @@ public function boot()
2929
3030 Event::listen ('tymon.jwt.absent ' , function () {
3131 return response ()->json (
32- ['reason ' => 'token ' , 'messages ' => ['Token não fornecido ' ]], 400 );
32+ ['reason ' => 'token ' , 'messages ' => ['Token not provided ' ]], 400 );
3333 });
3434
3535 Event::listen ('tymon.jwt.expired ' , function () {
3636 return response ()->json (
37- ['reason ' => 'token ' , 'messages ' => ['Token expirado ' ]], 400 );
37+ ['reason ' => 'token ' , 'messages ' => ['Expired Token ' ]], 400 );
3838 });
3939
4040 Event::listen ('tymon.jwt.invalid ' , function () {
4141 return response ()->json (
42- ['reason ' => 'token ' , 'messages ' => ['Token inválido ' ]], 400 );
42+ ['reason ' => 'token ' , 'messages ' => ['Invalid Token ' ]], 400 );
4343 });
4444 }
4545}
You can’t perform that action at this time.
0 commit comments