update: change the type
This commit is contained in:
@@ -106,11 +106,27 @@ export default {
|
||||
},
|
||||
filteredAgents() {
|
||||
return this.agents.filter(item => {
|
||||
if (this.draft.db_name === 'verity')
|
||||
// Handle new representation_type format (array)
|
||||
if (Array.isArray(item.representation_type)) {
|
||||
if (this.draft.db_name === 'verity') {
|
||||
return (
|
||||
item.representation_type.includes('mobile_accessories') ||
|
||||
item.representation_type.includes('computer_accessories') ||
|
||||
item.representation_type.includes('memory_products')
|
||||
)
|
||||
} else if (this.draft.db_name === 'panatech') {
|
||||
return (
|
||||
item.representation_type.includes('car_audio_video') || item.representation_type.includes('home_products')
|
||||
)
|
||||
}
|
||||
}
|
||||
// Handle legacy data
|
||||
else if (this.draft.db_name === 'verity') {
|
||||
return item.representation_type === 'verity' || item.representation_type === 'both'
|
||||
else if (this.draft.db_name === 'panatech')
|
||||
} else if (this.draft.db_name === 'panatech') {
|
||||
return item.representation_type === 'panatech' || item.representation_type === 'both'
|
||||
else return false
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user