Thank you for your help. What is the query I need to run to see the content of the user notes?
Is there some way I can see the fields that the note is stored in from the source code of the plug-in? Maybe I can show a custom_field for the user somehow?
discourse-user-notes/plugin.rb at main · discourse/discourse-user-notes · GitHub
I do not know how to ready Ruby, but maybe there is a field called user_notes in Discourse some place that I can search for with the user.id and then there is an object notes with a field of raw?
I’m just guessing. I may just pull the users and store the notes in a separate database, not Discourse. However, I would like to use the data in Discourse if possible as it will be easier to attach the note to a specific user and post.
notes = notes_for(user.id)
record = {
id: SecureRandom.hex(16),
user_id: user.id,
raw: raw,
created_by: created_by,
created_at: Time.now
}.merge(opts)
notes << record
::PluginStore.set("user_notes", key_for(user.id), notes)
user.custom_fields[COUNT_FIELD] = notes.size
user.save_custom_fields
I am pulling the list of users as admin to see which users have notes applied to them. After I identify the list of users with notes, I want to display the notes in a table so that staff can respond to questions more easily with the background information for the user.
I’m trying to use /user_notes.json?user_id=2
