Closed vipickering closed 4 years ago
This is because the micropub endpoint returns the url of the micropub type. Which is correct. It is a note. The problem is that I return images in a different location, despite the fact they are notes.
This is a non-critical bug and only affects the place a Micropub redirects to after publish.
I solved this by checking if there was an uploaded file, and if so, deriving the post type from the file’s mimetype (which is provided by Multer):
const deriveMediaType = mimetype => {
if (mimetype.includes('audio/')) {
return 'audio';
}
if (mimetype.includes('image/')) {
return 'photo';
}
if (mimetype.includes('video/')) {
return 'video';
}
};
Awesome thanks!
Image posts are returning the wrong url e.g. https://vincentp.me/notes/2019/03/15/15-12/
instead of: https://vincentp.me/photos/2019/03/15/15-12/