weitere perfektionierung der neuen mobile app

This commit is contained in:
Codex Agent
2025-12-11 12:18:08 +01:00
parent 7b01a77083
commit b4417db5cd
38 changed files with 4265 additions and 3040 deletions

View File

@@ -51,6 +51,21 @@ class TaskStoreRequest extends FormRequest
$fail('Der Benutzer gehört nicht zu diesem Tenant.');
}
}],
'emotion_id' => ['nullable', 'exists:emotions,id', function ($attribute, $value, $fail) use ($tenantId) {
$accessible = \App\Models\Emotion::where('id', $value)
->where(function ($query) use ($tenantId) {
$query->whereNull('tenant_id');
if ($tenantId) {
$query->orWhere('tenant_id', $tenantId);
}
})
->exists();
if (! $accessible) {
$fail('Die Emotion gehört nicht zu diesem Tenant.');
}
}],
];
}

View File

@@ -51,6 +51,21 @@ class TaskUpdateRequest extends FormRequest
$fail('Der Benutzer gehört nicht zu diesem Tenant.');
}
}],
'emotion_id' => ['sometimes', 'nullable', 'exists:emotions,id', function ($attribute, $value, $fail) use ($tenantId) {
$accessible = \App\Models\Emotion::where('id', $value)
->where(function ($query) use ($tenantId) {
$query->whereNull('tenant_id');
if ($tenantId) {
$query->orWhere('tenant_id', $tenantId);
}
})
->exists();
if (! $accessible) {
$fail('Die Emotion gehört nicht zu diesem Tenant.');
}
}],
];
}