fix: correct middleware ctx. key for versions

This commit is contained in:
ae 2025-04-19 16:58:04 +03:00
parent 4515127e8a
commit c730fd47c7
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E

View File

@ -280,9 +280,9 @@ func (rs *notesResource) CreateVersion(w http.ResponseWriter, r *http.Request) {
// Handler for returning full data of the currently scoped note version. Identical to the beginning // Handler for returning full data of the currently scoped note version. Identical to the beginning
// of the `RollbackNoteVersion` handler. // of the `RollbackNoteVersion` handler.
func (rs *notesResource) GetFullVersion(w http.ResponseWriter, r *http.Request) { func (rs *notesResource) GetFullVersion(w http.ResponseWriter, r *http.Request) {
fullVersion, ok := r.Context().Value(noteCtxKey{}).(*data.GetVersionRow) fullVersion, ok := r.Context().Value(versionCtxKey{}).(*data.GetVersionRow)
if !ok { if !ok {
respondError(w, http.StatusNotFound, "Note not found") respondError(w, http.StatusNotFound, "Version not found")
return return
} }