fix: merchant-user-detail page derives role from user.role instead of owned_merchants_count
Some checks failed
Some checks failed
The User Type status card used owned_merchants_count to determine Owner vs Team Member. Now uses user.role directly. Label changed from "User Type" to "Role". The other owned_merchants_count references (delete guards in user-edit.js and user-detail.js, count display card, debug log) are correct — they use the actual count for business logic, not role derivation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,17 +51,17 @@
|
||||
<!-- User Type -->
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 rounded-full"
|
||||
:class="merchantUser?.owned_merchants_count > 0
|
||||
:class="merchantUser?.role === 'merchant_owner'
|
||||
? 'text-orange-500 bg-orange-100 dark:text-orange-100 dark:bg-orange-500'
|
||||
: 'text-blue-500 bg-blue-100 dark:text-blue-100 dark:bg-blue-500'">
|
||||
<span x-html="$icon(merchantUser?.owned_merchants_count > 0 ? 'office-building' : 'user-group', 'w-5 h-5')"></span>
|
||||
<span x-html="$icon(merchantUser?.role === 'merchant_owner' ? 'office-building' : 'user-group', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
|
||||
User Type
|
||||
Role
|
||||
</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200"
|
||||
x-text="merchantUser?.owned_merchants_count > 0 ? 'Owner' : 'Team Member'">
|
||||
x-text="merchantUser?.role === 'merchant_owner' ? 'Merchant Owner' : 'Store Member'">
|
||||
-
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user