Browse Source

Added notification when official station is created

theflametrooper 8 years ago
parent
commit
ceb82576a0
2 changed files with 5 additions and 4 deletions
  1. 4 3
      backend/logic/actions/stations.js
  2. 1 1
      frontend/components/Admin/Stations.vue

+ 4 - 3
backend/logic/actions/stations.js

@@ -453,10 +453,11 @@ module.exports = {
 		], (err, station) => {
 			if (err) {
 				console.error(err);
-				return cb({ 'status': 'failure', 'message': 'Something went wrong.'});
+				return cb({ 'status': 'failure', 'message': 'Something went wrong'});
+			} else {
+				cache.pub('station.create', data._id);
+				cb({ 'status': 'success', 'message': 'Successfully created station' });
 			}
-			cache.pub('station.create', data._id);
-			cb({ 'status': 'success', 'message': 'Successfully created station.' });
 		});
 	}),
 

+ 1 - 1
frontend/components/Admin/Stations.vue

@@ -114,7 +114,7 @@
 					genres,
 					blacklistedGenres,
 				}, result => {
-					// Toast
+					Toast.methods.addToast(result.message, 3000);
 				});
 			},
 			removeStation: function (index) {