mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
25 lines
438 B
Go
25 lines
438 B
Go
package api
|
|
|
|
import (
|
|
"errors"
|
|
"net/http"
|
|
|
|
wallet "github.com/formancehq/wallets/pkg"
|
|
"github.com/go-chi/chi/v5"
|
|
)
|
|
|
|
func (m *MainHandler) getWalletHandler(wr http.ResponseWriter, r *http.Request) {
|
|
w, err := m.manager.GetWallet(r.Context(), chi.URLParam(r, "walletID"))
|
|
if err != nil {
|
|
switch {
|
|
case errors.Is(err, wallet.ErrWalletNotFound):
|
|
notFound(wr)
|
|
default:
|
|
internalError(wr, r, err)
|
|
}
|
|
return
|
|
}
|
|
|
|
ok(wr, w)
|
|
}
|