Skip to content
Snippets Groups Projects
Commit 90daa38a authored by Hans Kristian Hoel's avatar Hans Kristian Hoel
Browse files

remoced some unnused code

parent e3a8f046
No related branches found
No related tags found
No related merge requests found
...@@ -77,19 +77,6 @@ func FBRead() ([]WebhookRegistration, error) { ...@@ -77,19 +77,6 @@ func FBRead() ([]WebhookRegistration, error) {
Temp = append(Temp, webhook) Temp = append(Temp, webhook)
/*
tempCount := 0 // controll for duplicate
for i := range webhooks { // lopps true webhooks
if webhooks[i].ID == webhook.ID { // cheek it the webhook allready exist
tempCount++ //adds 1
}
}
if tempCount == 0 { // if tempCount is 0 it means that there is no duplicats and can add webhook
webhooks = append(webhooks, webhook)
}
*/
} }
return Temp, nil return Temp, nil
} }
......
...@@ -84,11 +84,6 @@ func WebhookHandeler2(w http.ResponseWriter, r *http.Request) { ...@@ -84,11 +84,6 @@ func WebhookHandeler2(w http.ResponseWriter, r *http.Request) {
parts := strings.Split(r.URL.Path, "/") //finds url parts parts := strings.Split(r.URL.Path, "/") //finds url parts
fmt.Println(parts) fmt.Println(parts)
// tempInt, err := strconv.Atoi(parts[4]) // gets the numid of choosen webhook
// if err != nil {
// http.Error(w, err.Error(), http.StatusBadRequest)
// }
for i := range webhooks { for i := range webhooks {
if webhooks[i].ID == parts[4] { if webhooks[i].ID == parts[4] {
err = json.NewEncoder(w).Encode(webhooks[i]) // encode choosen webhook err = json.NewEncoder(w).Encode(webhooks[i]) // encode choosen webhook
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment