Skip to content

feat: implement batch job fetching with get_jobs_batch contract function - #688

Open
TOS1ANO wants to merge 1 commit into
anumukul:mainfrom
TOS1ANO:feat/batch-job-fetching
Open

feat: implement batch job fetching with get_jobs_batch contract function#688
TOS1ANO wants to merge 1 commit into
anumukul:mainfrom
TOS1ANO:feat/batch-job-fetching

Conversation

@TOS1ANO

@TOS1ANO TOS1ANO commented Jul 30, 2026

Copy link
Copy Markdown

Linked Issue

Closes #587 [SC-101]

What Changed

Smart Contract

  • Added get_jobs_batch(start, limit) public view function returning Vec<Job>
  • Skips non-existent IDs safely (no panic) using Option<Job> pattern
  • Handles edge cases: start=0, limit=0, start > count
  • Backward compatible — get_job(id) kept unchanged

Frontend

  • Added getJobsBatch(startId, limit) helper in lib/contract.ts
  • Replaced N×getJob(id) loops with single batch calls on:
    • Home page
    • Dashboard (main fetch + bookmarked jobs)
    • Transactions page
    • Profile page
    • Compare page
    • Disputes loader

Bug Fixes

  • Fixed malformed JSX in layout.tsx (swapped closing tags for TypographyProvider/NetworkProvider)
  • Fixed missing </div> in ToastProvider.tsx causing JSX parse error
  • Moved SSR-disabled dynamic imports into ClientComponents.tsx to comply with Next.js App Router Server Component rules

Validation

  • TypeScript check passes with no new errors
  • Dev server starts without compilation errors
  • Contract function follows existing patterns
  • Backward compatible — individual getJob unchanged

Additional Notes

  • The ToastProvider.tsx now has two separate rendering containers for toasts (preserved existing behavior, only syntax fixed)

Add get_jobs_batch(start, limit) public view function to smart contract returning Vec<Job>, skipping non-existent IDs safely. Add getJobsBatch() frontend helper. Replace NxgetJob(id) loops with single batch calls on Home, Dashboard, Transactions, Profile, Compare pages and disputes-loader. Fix JSX nesting bugs in layout.tsx and ToastProvider.tsx. Move SSR-disabled dynamic imports into ClientComponents.tsx.
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@TOS1ANO Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@anumukul

anumukul commented Aug 5, 2026

Copy link
Copy Markdown
Owner

@TOS1ANO please resolve conflicts

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.

[SC-101] Add paginated job listing function for efficient querying

2 participants