drodil / backstage-plugin-qeta

Backstage.io plugin for Q&A
https://www.npmjs.com/package/@drodil/backstage-plugin-qeta
MIT License
81 stars 25 forks source link

bug: upload attachment with database storage saving attachments to database as well as file system #163

Closed kedaroh-bh closed 2 months ago

kedaroh-bh commented 2 months ago

There should if-else ladder, in case of 'database' storage it is going in 'database' and default condition

https://github.com/drodil/backstage-plugin-qeta/blob/main/plugins/qeta-backend/src/service/routes/attachments.ts#L85

As it is returning response twice, hence receiving unhandled error "Unhandled rejection Cannot set headers after they are sent to the client"

drodil commented 2 months ago

Good catch, I will make a fix!