feat: show Jobs tab for all vendors when no filter selected
- Add /admin/letzshop/jobs API endpoint for all jobs across vendors - Update list_letzshop_jobs service to support optional vendor_id - Remove x-if condition from Jobs tab button and panel - Update JS to use global or vendor-specific endpoint based on selection - Update jobs table subtitle to show context 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -702,6 +702,37 @@ def trigger_vendor_sync(
|
||||
# ============================================================================
|
||||
|
||||
|
||||
@router.get(
|
||||
"/jobs",
|
||||
response_model=LetzshopJobsListResponse,
|
||||
)
|
||||
def list_all_letzshop_jobs(
|
||||
job_type: str | None = Query(None, description="Filter: import, export, order_sync, historical_import"),
|
||||
status: str | None = Query(None, description="Filter by status"),
|
||||
skip: int = Query(0, ge=0),
|
||||
limit: int = Query(20, ge=1, le=100),
|
||||
db: Session = Depends(get_db),
|
||||
current_admin: User = Depends(get_current_admin_api),
|
||||
):
|
||||
"""
|
||||
Get unified list of all Letzshop-related jobs across all vendors.
|
||||
Combines product imports, exports, and order syncs.
|
||||
"""
|
||||
order_service = get_order_service(db)
|
||||
|
||||
jobs_data, total = order_service.list_letzshop_jobs(
|
||||
vendor_id=None,
|
||||
job_type=job_type,
|
||||
status=status,
|
||||
skip=skip,
|
||||
limit=limit,
|
||||
)
|
||||
|
||||
jobs = [LetzshopJobItem(**job) for job in jobs_data]
|
||||
|
||||
return LetzshopJobsListResponse(jobs=jobs, total=total)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/vendors/{vendor_id}/jobs",
|
||||
response_model=LetzshopJobsListResponse,
|
||||
|
||||
Reference in New Issue
Block a user