81e7223560
Text Extraction * bases * go * splitting * structure * movetoasync * movetoasync * settinguptrigger * reorder * storevent * standardisepollingvalidation * unittests * fixlint * fixlint * awscfg * generatesample * followthrough * tests * clena * store * externalidcleanup * clientid * local * baseunittests * putobjecttests * tests
20 lines
441 B
Go
20 lines
441 B
Go
package queryapi
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func (s *Controllers) GetStatusByClientId(ctx echo.Context, id ClientID) error {
|
|
status, err := s.svc.Client.GetStatus(ctx.Request().Context(), id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to find client: %s", err))
|
|
}
|
|
|
|
return ctx.JSON(http.StatusOK, ClientStatusBody{
|
|
Status: parseClientStatus(status),
|
|
})
|
|
}
|