Skip to content

Commit e11410b

Browse files
authored
Update AdminProfileResource.php (#427)
1 parent 533c04f commit e11410b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app/Http/Resources/AdminProfileResource.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ public function toArray(Request $request): array
3636
$deleteAfter = $this->user->delete_after;
3737
}
3838

39+
$statusDesc = $this->getStatusDescription();
40+
41+
// For local accounts, check if email is verified
42+
if ($this->local && $this->status === 1 && $this->user && ! $this->user->email_verified_at) {
43+
$statusDesc = 'unverified';
44+
}
45+
3946
return [
4047
'id' => (string) $this->id,
4148
'name' => $this->name ?? 'user'.$this->id,
@@ -53,7 +60,7 @@ public function toArray(Request $request): array
5360
'is_suspended' => $this->is_suspended,
5461
'is_hidden' => $this->is_hidden,
5562
'status' => $this->status,
56-
'status_desc' => $this->getStatusDescription(),
63+
'status_desc' => $statusDesc,
5764
'can_upload' => $this->can_upload,
5865
'can_share' => $this->can_share,
5966
'can_like' => $this->can_like,

0 commit comments

Comments
 (0)