I’m sorry if this is wrong area but does Discourse fire an event when the profile JSON file is requested over HTTP?
https://meta.discourse.org/u/Marcy.json for example.
إعجاب واحد (1)
No it does not, you would have to write a plugin to intercept that info.
إعجابَين (2)
I’d like to but I’m unsure where to start. I want to change information on the JSON file before it’s displayed to the client.
إعجاب واحد (1)
That would mean you want to amend the serializer, look at plugins such as discourse assign or discourse solved that make serializer changes.
3 إعجابات
Thanks for the tip, I found this which I assume makes the {Username}.json file?
https://github.com/discourse/discourse/blob/master/app/serializers/user_serializer.rb
Is there any Discourse Ruby API on what events exist, etc? As I don’t know how I’d make changes to it before being displayed as I wanna change the email field before it’s displayed.