Starlio-web/api/controllers/wallpaper.go
2022-09-25 11:04:39 +03:00

22 lines
446 B
Go

package controllers
import (
"github.com/Redume/EveryNasa/api/utils"
"github.com/Redume/EveryNasa/functions"
"github.com/reujab/wallpaper"
"net/http"
)
var WallpaperUpdate = func(w http.ResponseWriter, r *http.Request) {
var url string
url = r.FormValue("url")
if url == "" {
utils.Respond(w, utils.Message(false, "URL is required"))
return
}
err := wallpaper.SetFromURL(url)
if err != nil {
functions.Logger(err.Error())
}
}