hackmdio / codimd

CodiMD - Realtime collaborative markdown notes on all platforms.
https://hackmd.io/c/codimd-documentation
GNU Affero General Public License v3.0
9.11k stars 1.05k forks source link

fix: use encoded note id to update history #1804

Closed bbtfr closed 1 year ago

bbtfr commented 1 year ago

fixes: https://github.com/hackmdio/codimd/pull/1570

In the current version, if I call PUT /api/notes/:noteId, my note will be updated properly, but in history page, I will get 2 notes with the same name, one linked to /uuid (which can not be opened, 404) and the other linked to /encoded_id (this is what I want)

I did some digging, and noticed that both note.id and noteId here in updateNote are uuid, not encoded note id, we have to call Note.encodeNoteId to make it work

bbtfr commented 1 year ago

Hi, @jackycute can you please take a look when you get a chance?

jackycute commented 1 year ago

Hi @bbtfr, This looks good to me.

jackycute commented 1 year ago

@bbtfr Thanks for your PR!