mock mode: database queries implemented and checkbox on account page built

This commit is contained in:
2026-02-26 22:54:58 -07:00
parent 85817a4adb
commit c6b8a9a00d
10 changed files with 278 additions and 27 deletions
+14 -2
View File
@@ -167,10 +167,22 @@ func ErrorFromConstant(err error) error {
cerr := err
for cerr != nil {
switch cerr {
// if the error already is an ErrorResponse with the appropriate status, nothing needs to be done.
// else the error needs to be wrapped in the appropriate ErrorResponse.
case consts.ErrNotFound:
return NotFound()
if er, ok := GetError(err); ok {
if s, ok := er.GetStatus(); ok && s == http.StatusNotFound {
return err
}
}
return NotFound().Wrap(err)
case consts.ErrConflict:
return Conflict()
if er, ok := GetError(err); ok {
if s, ok := er.GetStatus(); ok && s == http.StatusConflict {
return err
}
}
return Conflict().Wrap(err)
}
uerr, ok := cerr.(interface {