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:
2025-12-25 00:30:33 +01:00
parent 50fd1d01c2
commit bedc979b12
5 changed files with 91 additions and 46 deletions

View File

@@ -158,7 +158,8 @@ function adminMarketplaceLetzshop() {
// Watch for tab changes to reload relevant data
this.$watch('activeTab', async (newTab) => {
marketplaceLetzshopLog.info('Tab changed to:', newTab);
if (newTab === 'jobs' && this.selectedVendor) {
if (newTab === 'jobs') {
// Load jobs for selected vendor or all Letzshop jobs
await this.loadJobs();
} else if (newTab === 'products') {
// Load products for selected vendor or all Letzshop products
@@ -1418,17 +1419,9 @@ function adminMarketplaceLetzshop() {
},
/**
* Load jobs for selected vendor
* Note: Jobs are vendor-specific, so we need a vendor selected to show them
* Load jobs for selected vendor or all vendors
*/
async loadJobs() {
// Jobs require a vendor to be selected (they are vendor-specific)
if (!this.selectedVendor) {
this.jobs = [];
this.jobsPagination.total = 0;
return;
}
this.loadingJobs = true;
try {
@@ -1444,7 +1437,12 @@ function adminMarketplaceLetzshop() {
params.append('status', this.jobsFilter.status);
}
const response = await apiClient.get(`/admin/letzshop/vendors/${this.selectedVendor.id}/jobs?${params}`);
// Use vendor-specific or global endpoint based on selection
const endpoint = this.selectedVendor
? `/admin/letzshop/vendors/${this.selectedVendor.id}/jobs?${params}`
: `/admin/letzshop/jobs?${params}`;
const response = await apiClient.get(endpoint);
this.jobs = response.jobs || [];
this.jobsPagination.total = response.total || 0;
} catch (error) {