diff --git a/api/routes.go b/api/routes.go index 8199b257..8213b220 100644 --- a/api/routes.go +++ b/api/routes.go @@ -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) diff --git a/resource/avatar.go b/resource/avatar.go index dc1f82ac..2f867624 100644 --- a/resource/avatar.go +++ b/resource/avatar.go @@ -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) }