2024-12-16 15:29:54 -05:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/labstack/echo/v4"
|
|
|
|
|
|
|
|
|
|
"github.com/onsonr/sonr/internal/nebula/input"
|
2024-12-18 15:53:45 -05:00
|
|
|
"github.com/onsonr/sonr/pkg/gateway/middleware"
|
2024-12-16 15:29:54 -05:00
|
|
|
)
|
|
|
|
|
|
2024-12-18 15:53:45 -05:00
|
|
|
// CheckProfileHandle finds the chosen handle and verifies it is unique
|
|
|
|
|
func CheckProfileHandle(c echo.Context) error {
|
2024-12-16 15:29:54 -05:00
|
|
|
handle := c.FormValue("handle")
|
2024-12-18 15:53:45 -05:00
|
|
|
if handle == "" {
|
|
|
|
|
return middleware.Render(c, input.HandleError(handle, "Please enter a valid handle"))
|
|
|
|
|
}
|
2024-12-16 15:29:54 -05:00
|
|
|
//
|
|
|
|
|
// if ok {
|
|
|
|
|
// return middleware.Render(c, input.HandleError(handle))
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
return middleware.Render(c, input.HandleSuccess(handle))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ValidateProfileHandle finds the chosen handle and verifies it is unique
|
2024-12-18 15:53:45 -05:00
|
|
|
func CheckIsHumanSum(c echo.Context) error {
|
2024-12-16 15:29:54 -05:00
|
|
|
// data := context.GetCreateProfileData(c)
|
|
|
|
|
// value := c.FormValue("is_human")
|
|
|
|
|
// intValue, err := strconv.Atoi(value)
|
|
|
|
|
// if err != nil {
|
|
|
|
|
// return middleware.Render(c, input.HumanSliderError(data.FirstNumber, data.LastNumber))
|
|
|
|
|
// }
|
|
|
|
|
// if intValue != data.Sum() {
|
|
|
|
|
// return middleware.Render(c, input.HumanSliderError(data.FirstNumber, data.LastNumber))
|
|
|
|
|
// }
|
|
|
|
|
return middleware.Render(c, input.HumanSliderSuccess())
|
|
|
|
|
}
|