A way to map fields when you get them?

Hello, I'd like to know if there a way to map a field before the front get it please? For example I have an image for the user but I save it in a S3 bucket. I only save the path in the database without the main endpoint url. I'd like to map it like that :
return { image: process.env['S3_ORIGIN'].replace(/\/$/, '') + '/' + path.replace(/^\//, '') }
return { image: process.env['S3_ORIGIN'].replace(/\/$/, '') + '/' + path.replace(/^\//, '') }
2 Replies
Hiếu Trần
Hiếu Trần2mo ago
Using customSession man
Miyonu
MiyonuOP4w ago
ah thanks I didn't know that exists! 🙏

Did you find this page helpful?