-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: #55 User configuration for relay controls #57
feat: #55 User configuration for relay controls #57
Conversation
5258d05
to
4756a35
Compare
Thanks for picking up work on this <3 How do you feel about splitting this up into a settings object (or use this existing one?). I don't know how much we want to pump up the main user object. (I have to clean up the settings object anyway at some point :D ) |
I think it's a good idea to use the UserSettings storage if that fits better with your plans. I tried to implement that but didn't have any luck constructing syntax to update it on save. And AFAICT that UserSettings storage is not yet in use? I'm not familiar with this stack so likely missed some details ... Storing against User worked for my purposes, happy to refine, appreciate any pointers 😄 What I tried was, below the existing Lines 57 to 66 in db8fae4
I tried a few variations to update if (user?.UserSettings) {
await db.userSettings.update({
where: {
userId: req.user.id,
},
data: {
relayCriteria: req.body.relayCriteria ?? user.UserSettings.relayCriteria,
relayMarker: req.body.relayMarker ?? user.UserSettings.relayMarker,
},
});
} So I put the storage back against User, which works, and am happy to revisit with guidance. It looks to me that the existing UserSettings columns suggest you already had some thinking about storing similar details, but I'm not clear what is/isn't in use. (It's fine to push new commits to this MR if that suits you, or the storage details could be dealt with in a follow-up if this is sufficient.) Hah, just realised I had missed committing my migrations to this MR. I will add them in the current state and rebase to target |
aead561
to
737ff80
Compare
@thilobillerbeck I did try using the UserSettings object, but had no luck making that work, so I've prototyped with storage directly on the User schema (for now, anyway). For my testing, this is working OK so far! Will road test it myself over the xmas/NY break, happy to hear any input or testing feedback folks have. New contributor to Typescript projects so feedback on style very welcome 😀 |
945150a
to
db5f1fd
Compare
4ef5b67
to
3bcfe9b
Compare
3bcfe9b
to
e517bc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works, thanks for contributing <3
🎉 This PR is included in version 0.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Works, input welcome!
In this PR
Data / schema changes
relayCriteria
(all, favedBySelf, containsMarker, notContainsMarker) andrelayMarker
(string) to UserConstraint
class to pass togetNewToots()
UI changes
Below "Bluesky App Password" input on root (
/
) form: