Commit 9e508c2
fix(vendors): skip assignee validation when assignee hasn't changed
* fix(vendors): skip assignee validation when assignee hasn't changed
The form sends the existing assigneeId on every PATCH even when
the user only changed a different field (e.g. website). If the
vendor's current assignee is a platform admin, every update fails
with "Cannot assign a platform admin as assignee" — even though
no one is trying to change the assignee.
Only run validateAssigneeNotPlatformAdmin when assigneeId is
actually being changed to a different value.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(vendors): don't assign platform admins as vendor assignees during onboarding
The vendor mitigation task assigned vendors to whoever triggered
onboarding (authorId). When a platform admin onboards a customer,
all vendors get assigned to the admin. Since platform admins are
filtered from the UI assignee list, vendors appear "Unassigned"
but the backend still has the admin's member ID — which then
blocks all PATCH updates with "Cannot assign a platform admin".
Two fixes:
- Service: only validate assignee when it's actually changing
- Onboarding: skip assignee if author is a platform admin
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c7eb66a commit 9e508c2
File tree
2 files changed
+15
-4
lines changed- apps
- api/src/vendors
- app/src/trigger/tasks/onboarding
2 files changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
| 603 | + | |
604 | 604 | | |
605 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
606 | 610 | | |
607 | 611 | | |
608 | 612 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
52 | | - | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
0 commit comments