mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Fix event api
This commit is contained in:
		
							parent
							
								
									78434a7ca1
								
							
						
					
					
						commit
						1777b5a510
					
				| @ -9,7 +9,7 @@ module.exports = function (app) { | ||||
|     }); | ||||
| 
 | ||||
|     app.get('/events/:name', function (req, res) { | ||||
|         eventDb.getEvents(req.params.name).then(function (events) { | ||||
|         eventDb.getEventsFilterByName(req.params.name).then(function (events) { | ||||
|             if (events) { | ||||
|                 res.json(events); | ||||
|             } else { | ||||
|  | ||||
| @ -23,7 +23,7 @@ function getEvents() { | ||||
|     }); | ||||
| } | ||||
| 
 | ||||
| function getEvents(name) { | ||||
| function getEventsFilterByName(name) { | ||||
|     var sql = 'SELECT id, type, created_by as created, data ' + | ||||
|     'FROM events WHERE data ->> \'name\' = $1 ' + | ||||
|     'ORDER BY created_at DESC'; | ||||
| @ -46,5 +46,6 @@ function mapToEvent(row) { | ||||
| 
 | ||||
| module.exports = { | ||||
|     store: storeEvent, | ||||
|     getEvents: getEvents | ||||
|     getEvents: getEvents, | ||||
|     getEventsFilterByName: getEventsFilterByName | ||||
| }; | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user