add delete spaceurl delete route
This commit is contained in:
parent
1ab9d78736
commit
04e022f4d8
3 changed files with 30 additions and 1 deletions
|
|
@ -62,6 +62,15 @@ func SpaceUrlUpdate(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
func SpaceUrlDelete(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
SharedSecret := vars["SharedSecret"]
|
||||
Id := vars["id"]
|
||||
if SharedSecret == config.SharedSecret {
|
||||
deleteSpaceurl(Id)
|
||||
}
|
||||
}
|
||||
|
||||
func loadSpaceData() {
|
||||
spaceUrls := readSpaceurl()
|
||||
|
||||
|
|
@ -71,7 +80,8 @@ func loadSpaceData() {
|
|||
if(spaceUrl.Validated && int64(spaceUrl.LastUpdated + 60) < timestamp) {
|
||||
spaceData := SpaceData{}
|
||||
err := getJson(spaceUrl.Url, &spaceData)
|
||||
if(err != nil) {
|
||||
if err != nil
|
||||
{
|
||||
log.Println(spaceUrl.Url)
|
||||
log.Println(err)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue