add page profile for the admins
This commit is contained in:
29
handlers/application/conseillers.go
Normal file
29
handlers/application/conseillers.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package application
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||
)
|
||||
|
||||
func (h *ApplicationHandler) ConseillerDisplay(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
adm := strings.Split(r.URL.Path, "/")
|
||||
adminid := adm[3]
|
||||
|
||||
request := &mobilityaccounts.GetAccountRequest{
|
||||
Id: adminid,
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
h.Renderer.ConseillerDisplay(w, r, resp.Account.ToStorageType())
|
||||
}
|
||||
Reference in New Issue
Block a user