Skip to content
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

Add DELETE functionality to bags and recipe cards #8822

Open
wants to merge 4 commits into
base: multi-wiki-support
Choose a base branch
from

Conversation

well-noted
Copy link
Contributor

Adds delete handlers to post-recipe and post-bag, adds delete functions to sql-tiddler-store and sql-tiddler-database, and adds buttons to get-index.tid

Copy link

@well-noted It appears that this is your first contribution to the project, welcome.

With apologies for the bureaucracy, please could you prepare a separate PR to the 'tiddlywiki-com' branch with your signature for the Contributor License Agreement (see contributing.md).

Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit f82425a
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/676336548bbb380008710b8d
😎 Deploy Preview https://deploy-preview-8822--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

well-noted has signed the Contributor License Agreement (see contributing.md)

Copy link
Member

@Jermolene Jermolene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @well-noted, much appreciated.

sqlTiddlerDatabase = server.sqlTiddlerDatabase;

// Handle DELETE request
if(state.data._method === "DELETE") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not keen on the way that the DELETE /bags/:bag-name method is piggybacked into the same handler as the POST /bags method.

I'd prefer to implement DELETE /bags/:bag-name as a separate handler, and to move the logic that allows POST as a synonym for DELETE into mws-server.js (similarly to the PUT/POST mapping it already does). This would allow REST purists to do things properly if they want to.

@@ -4,57 +4,83 @@ type: application/javascript
module-type: mws-route

POST /recipes
DELETE /recipes (via _method=DELETE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this should be its own separate handler

recipe: {
table: "recipes",
column: "recipe_name"
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diffs here are messed up by the formatting changes which makes it hard to review them, so I'll come back to this once the formatting is fixed.

@Jermolene Jermolene mentioned this pull request Dec 22, 2024
Copy link
Member

@Jermolene Jermolene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @well-noted this looks good to go apart from the unwanted whitespace changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants