sonr/pkg/gateway/handlers/check_handler.go
Prad Nukala 6072f6ecfa
feature/implement wss routes (#1196)
* feat(database): create schema for hway and motr

* fix(gateway): correct naming inconsistencies in handlers

* build: update schema file to be compatible with postgresql syntax

* fix: update schema to be compatible with PostgreSQL syntax

* chore: update query_hway.sql to follow sqlc syntax

* ```text
refactor: update query_hway.sql for PostgreSQL and sqlc
```

* feat: add vaults table to store encrypted data

* refactor: Update vaults table schema for sqlc compatibility

* chore(deps): Upgrade dependencies and add pgx/v5

* refactor(Makefile): move sqlc generate to internal/models

* docs(foundations): remove outdated pages

* chore(build): add Taskfile for build tasks

* refactor(embed): move embed files to internal package

* docs: add documentation for Cosmos SDK ORM
2024-12-18 20:53:45 +00:00

37 lines
1.1 KiB
Go

package handlers
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/internal/nebula/input"
"github.com/onsonr/sonr/pkg/gateway/middleware"
)
// CheckProfileHandle finds the chosen handle and verifies it is unique
func CheckProfileHandle(c echo.Context) error {
handle := c.FormValue("handle")
if handle == "" {
return middleware.Render(c, input.HandleError(handle, "Please enter a valid handle"))
}
//
// 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
func CheckIsHumanSum(c echo.Context) error {
// 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())
}