Skip to content

Implement soft delete for bounties (Closes #235)#343

Open
Halo11112222 wants to merge 2 commits intoGalactiGuild:mainfrom
Halo11112222:feat/bounty-soft-delete
Open

Implement soft delete for bounties (Closes #235)#343
Halo11112222 wants to merge 2 commits intoGalactiGuild:mainfrom
Halo11112222:feat/bounty-soft-delete

Conversation

@Halo11112222
Copy link
Copy Markdown

Hey! 👋

I saw the issue about soft deleting bounties and thought I'd take a crack at it.

What I changed:

In bounty.service.ts:

  • Added deletedAt: null filter to findOne, get, findAll, and search queries so deleted bounties never show up in listings
  • Added a remove() method that sets deletedAt = new Date() instead of doing a hard delete

In bounty.controller.ts:

  • Added DELETE /bounties/:id endpoint that calls the new remove() method
  • Requires JWT auth and only the creator can delete their own bounty

The schema already had the deletedAt field on the Bounty model, so I just had to wire up the filtering and the soft delete logic.

Let me know if you'd like any changes! Happy to tweak the approach.

- Add deletedAt filter to findOne, get, findAll, and search queries
- Add remove() method that sets deletedAt timestamp instead of hard delete
- Ensures deleted bounties don't appear in any listings
- Adds soft delete endpoint that calls service.remove()
- Requires JWT auth (only creator can delete)
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.

1 participant