-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
fix: set link default value to random (copy) #181
Conversation
This Pull Request resolves #180 |
Nice, thanks again for all your PRs :) |
No problems, I'm working on the reverse shares options. |
I'll just need help because I had to modify a bit the database, to add a string, which contains a JSON object : export type ReverseShareOptions = {
easyMode: boolean;
customLinkEnabled: boolean;
passwordEnabled: boolean;
descriptionEnabled: boolean;
maximalViewsEnabled: boolean;
} And I also changed the backend service and DTOs, but I would like to add this modification, without breaking the current db, how can I do that ? I would like to put default values for all the current reverse shares but I don't know how to do ... |
For the frontend there is no problem, because I can do smth like this : const getMyReverseShares = async (): Promise<MyReverseShare[]> => {
const shares = (await api.get("reverseShares")).data;
for (const share of shares)
{
share.sharesOptions = JSON.parse(share.sharesOptions);
if(Object.keys(share.sharesOptions).length === 0)
share.sharesOptions = structuredClone(defaultReverseShareOptions);
}
return shares;
}; But the backend db resets if the schema has changed. Personally, I have regenerated the db :
But for all the other users, how could I make the new release without having to reset their db ? |
@pierrbt I probably would add a new table and add a 1:1 connection between the For the migration part, it is quite easy with prisma. You just have to run Btw. you can write me on Discord (stonith404) then we don't have to discuss things in random PRs or issues. |
* fix: set link default value to random * fix: add auto EOL and add conventional-changelog package * feat: Adding reverse shares' shares a clickable link (#178) * Add clickable link to reverse share's shares * Ran format * Apply suggestions from code review * fix: set link default value to random (#181) * fix: set link default value to random * fix: add auto EOL and add conventional-changelog package * Apply suggestions from code review --------- Co-authored-by: Elias Schneider <[email protected]> * feat: Adding reverse share ability to copy the link (#179) --------- Co-authored-by: Elias Schneider <[email protected]>
* Add clickable link to reverse share's shares * Ran format * Adding copy icon to the reverse share list * Remove console.log * Ran format * Ran format in backend * fix: copy to clipboard spelling * Open the share in another window * feat: Adding reverse shares' shares a clickable link (#178) * Add clickable link to reverse share's shares * Ran format * fix: set link default value to random (#181) * fix: set link default value to random * fix: add auto EOL and add conventional-changelog package * Apply suggestions from code review --------- Co-authored-by: Elias Schneider <[email protected]> * feat: Adding reverse share ability to copy the link (#179) --------- Co-authored-by: Elias Schneider <[email protected]>
The link input has now a default value, which is a random string.
I've kept the Generate link to make another one, if the user wants, or if he make a bad manipulation and have to generate another link.