A useful code for letting any user join the topics created by a particular user #115
square-foot
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I was playing around with databag and I loved the concept. I have some suggestions that could probably improve its use. (There is a suggestion I had made several months back, but that may be an esoteric suggestion) I think it is an excellent system which should see wider usage.
But before that, I wanted to share a useful piece of code that I wrote in Javascript that I think can help others. When a new user joins, he is facing a largely blank screen with no idea what to do next. So I wrote this utility to allow to join a list of topics previously made by another user.
The Javascript I used is the one used on the server side of Pocketbase (another excellent system) but I think it is
quite easily adaptable for other types of Javascript (Nodejs, etc) This code will find out the list of topics made by a particular user (in my case 'adminchat' and then adds the new user to one of the topics of 'adminchat'.
Only those topics which has a "Subject" can be used here. The handle (i.e. username) of the user who wants to use should at least send a connection request to 'adminchat'.
I did not have much access to the API. I tried importing the .oa3 file (there is a small bug in the format which I had to remove) into Postman and I got a rough idea. But I could figure out what was going on based on the inspection of the browser console when playing around with Databag.
I don't think there is any security risks in the way Databag carries out its tasks but the API calls are quite unusual (or maybe I have misunderstood some and by some luck all this seems to work)
Hope this is useful to others. I will make my suggestions in another section of these discussions. Hope Databag is used widely! All the best.
Beta Was this translation helpful? Give feedback.
All reactions