Skip to content

feat: add edit and delete actions for sales entries#155

Open
Dipti1516 wants to merge 1 commit into
rushikesh-bobade:mainfrom
Dipti1516:feat/edit-delete-sales-v2
Open

feat: add edit and delete actions for sales entries#155
Dipti1516 wants to merge 1 commit into
rushikesh-bobade:mainfrom
Dipti1516:feat/edit-delete-sales-v2

Conversation

@Dipti1516

Copy link
Copy Markdown

Summary

This PR adds edit and delete functionality for sales entries.

Changes

  • Added Edit action for sales entries.
  • Added Delete action with confirmation modal.
  • Restored Sale Price and Sale Date fields in the sale modal.
  • Updated backend edit action to persist platform fees and shipping costs.
  • Preserved inventory status consistency when deleting sales.
  • Included IDOR ownership validation for secure edit/delete operations.

Testing

  • ✅ Create sale
  • ✅ Edit sale
  • ✅ Delete sale
  • ✅ Profit calculation
  • ✅ Inventory status updates correctly
Screenshot (482)

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

@Dipti1516 is attempting to deploy a commit to the participationcorner2025-8967's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Codesense Ai: This PR is too large to review automatically. A human maintainer will take a look!

@github-actions github-actions Bot added the ECSoC26 Required label for ECSOC Sentinel scoring label Jul 11, 2026
@rushikesh-bobade

Copy link
Copy Markdown
Owner

Hi @Dipti1516,

Thank you so much for moving this over to a clean branch! The commit history looks perfect now, and your fixes for the HTML layout and IDOR security checks carried over flawlessly.

However, there is a critical issue that happened during the migration. When you recreated this branch, it looks like you might have copy-pasted your old sales-log.tsx file over the new one. By doing this, you accidentally deleted the Sorting and Pagination features that were recently merged into main!

If you look at the "Files changed" tab for app/routes/sales-log.tsx in this PR, you'll see a lot of red deletions for things like handleSort, useSearchParams, and sortDirection.

To fix this, you'll need to carefully restore those missing features. The easiest way to do this without losing your Edit/Delete logic is to:

  1. Run git checkout origin/main -- app/routes/sales-log.tsx to pull the latest file from main.
  2. Manually copy your intent === "edit" and intent === "delete" backend blocks back into the action.
  3. Manually copy your LogSaleModal and DeleteSaleModal UI blocks back into the return statement at the bottom.

Let me know if you need any help navigating this! It's a very common Git mistake, and once we get those sorting features restored alongside your amazing Edit/Delete work, this will be merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ECSoC26 Required label for ECSOC Sentinel scoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants