Fix reference to avatar URI
This commit is contained in:
parent
aa02d2e729
commit
f9934095b3
2 changed files with 3 additions and 3 deletions
|
|
@ -17,7 +17,7 @@ func AddRoutes(r *mux.Router) {
|
|||
r.Handle("/audio/{uuid}", auth.NewEnsureAuth(apiAudioPost)).Methods("POST")
|
||||
r.Handle("/audio/{uuid}/content", auth.NewEnsureAuth(apiAudioContentPost)).Methods("POST")
|
||||
avatar := resource.Avatar(router)
|
||||
r.Handle("/avatar/{uuid}", authenticatedHandlerGetImage(avatar.ByIDGet)).Methods("GET").Name("avatar.ByUUIDGet")
|
||||
r.Handle("/avatar/{uuid}", authenticatedHandlerGetImage(avatar.ByUUIDGet)).Methods("GET").Name("avatar.ByUUIDGet")
|
||||
r.Handle("/avatar", authenticatedHandlerPostMultipart(avatar.Create, file.CollectionAvatar)).Methods("POST")
|
||||
r.Handle("/client/ios", auth.NewEnsureAuth(handleClientIos)).Methods("GET")
|
||||
communication := resource.Communication(r)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ type avatar struct {
|
|||
URI string `json:"uri"`
|
||||
}
|
||||
|
||||
func (res *avatarR) ByIDGet(ctx context.Context, r *http.Request, u platform.User) (file.Collection, uuid.UUID, *nhttp.ErrorWithStatus) {
|
||||
func (res *avatarR) ByUUIDGet(ctx context.Context, r *http.Request, u platform.User) (file.Collection, uuid.UUID, *nhttp.ErrorWithStatus) {
|
||||
vars := mux.Vars(r)
|
||||
uid_str := vars["uuid"]
|
||||
uid, err := uuid.Parse(uid_str)
|
||||
|
|
@ -45,7 +45,7 @@ func (res *avatarR) Create(ctx context.Context, r *http.Request, u platform.User
|
|||
if err != nil {
|
||||
return nil, nhttp.NewErrorStatus(http.StatusBadRequest, "Create avatar: %w", err)
|
||||
}
|
||||
uri, err := res.router.UUIDToURI("avatar.ByIDGet", &upload.UUID)
|
||||
uri, err := res.router.UUIDToURI("avatar.ByUUIDGet", &upload.UUID)
|
||||
if err != nil {
|
||||
return nil, nhttp.NewError("create uri: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue