Skip to content

fix: resolve all backend issues#166

Open
navin-oss wants to merge 3 commits intoNitya-003:mainfrom
navin-oss:fix/backend-issues
Open

fix: resolve all backend issues#166
navin-oss wants to merge 3 commits intoNitya-003:mainfrom
navin-oss:fix/backend-issues

Conversation

@navin-oss
Copy link
Contributor

@navin-oss navin-oss commented Mar 6, 2026

Fixes Applied:

  1. server.js - Duplicate mongoose declaration - Removed duplicate on line 24

  2. server.js - generateBatchId function - Fixed missing closing braces and removed duplicate definition

  3. server.js - contractABI - Aligned with CropChain.sol:

    • BatchUpdated: string stageuint8 stage (enum)
    • createBatch: 3 params → 7 params (batchId, cropTypeHash, ipfsCID, quantity, actorName, location, notes)
    • Added updateBatch function
  4. reconcile.js - Fixed broken blockchain iteration:

    • Uses getTotalBatches() instead of non-existent getBatchCount()
    • Uses getBatchIdIndex(i) instead of non-existent batches(i)
  5. server.js - Authentication - Removed duplicate auth middleware, uses middleware from auth.js exclusively

  6. New file: config/blockchain.js - Provides getContract() function

@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for roaring-ganache-c7465f failed. Why did it fail? →

Name Link
🔨 Latest commit ee07737
🔍 Latest deploy log https://app.netlify.com/projects/roaring-ganache-c7465f/deploys/69ad045ac068270008288830

@vedhapprakashni
Copy link
Collaborator

@navin-oss resolve conflicts

Copy link
Owner

@Nitya-003 Nitya-003 left a comment

Choose a reason for hiding this comment

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

@navin-oss Please the mention you are resolving. I am assigning you all the issues raised by you but please mention the issue number you are solving so it gets easier for us.

Image

@vedhapprakashni
Copy link
Collaborator

@navin-oss which issue does this close?

@vedhapprakashni
Copy link
Collaborator

@navin-oss pls resolve conflicts in 3 pr's you opened

@vedhapprakashni
Copy link
Collaborator

@navin-oss pls check this asap

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