Fix #92 , Added /Sensor route for GET , POST request to list all sensors .#102
Open
Tushar-kalsi wants to merge 12 commits into
Open
Fix #92 , Added /Sensor route for GET , POST request to list all sensors .#102Tushar-kalsi wants to merge 12 commits into
Tushar-kalsi wants to merge 12 commits into
Conversation
Fixed honeynet#96 Some changes in handler.go file in publishHandler function intersepted msg []byte object decode it , made changes as per requirnments .
…ckend
Removed .split ('-')[0] from front end code and already added this logic in backend
I have made changes as per discussion please review .
Added some file for /sensor route.
Added /Sensor route as GET request to list all sensors stored by owner id . POST request for adding sensor under current user id as owner id .
Added /sensor route .
glaslos
requested changes
Dec 3, 2023
|
|
||
| userId := userIDFromCtx(r.Context()) | ||
| events, err := cs.sensorRepo.GetSensorsByOwnerId(userId) | ||
|
|
Member
There was a problem hiding this comment.
No newline here needed as the error handling is directly related to the repo call
|
|
||
| } | ||
|
|
||
| func (r *SensorRepo) AddSensors(sensor entities.Sensor, userId string) error { |
Member
There was a problem hiding this comment.
only pass the sensor entity, assign the user_id in the handler
Comment on lines
+11
to
+13
| func TestGetSesors(t *testing.T) { | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/sensorGET request for returning all sensors stored under current user Owner id ,/sensorPOST request for adding new sensor under current user Owner id .Please verify my approch and let me know the inputs .
Thanks