seeder changes #7

Merged
mohanmd merged 1 commits from mohan into master 2026-06-15 10:29:47 +00:00
3 changed files with 8 additions and 8 deletions

View File

@ -30,6 +30,7 @@ public function run(): void
// Call Seeders
$this->call([
SkillSeeder::class,
AdminSeeder::class,
]);
}
}

View File

@ -32,14 +32,14 @@ export default function ReportReasons({ reasons }) {
const [editingReason, setEditingReason] = useState(null);
const [reasonName, setReasonName] = useState('');
const [reasonStatus, setReasonStatus] = useState('Active');
const [reasonType, setReasonType] = useState('Both');
const [reasonType, setReasonType] = useState('Chat');
const [error, setError] = useState('');
const handleOpenAdd = () => {
setEditingReason(null);
setReasonName('');
setReasonStatus('Active');
setReasonType('Both');
setReasonType('Chat');
setError('');
setIsDialogOpen(true);
};
@ -48,7 +48,7 @@ export default function ReportReasons({ reasons }) {
setEditingReason(reason);
setReasonName(reason.reason);
setReasonStatus(reason.status);
setReasonType(reason.type || 'Both');
setReasonType(reason.type || 'Chat');
setError('');
setIsDialogOpen(true);
};
@ -218,7 +218,7 @@ export default function ReportReasons({ reasons }) {
<div className="flex items-start space-x-3 text-slate-400">
<Info className="w-4 h-4 shrink-0 mt-0.5" />
<p className="text-[10px] font-bold uppercase tracking-wide leading-relaxed">
Tip: Scoping reasons to "Chat" or "Review" helps filter options on the mobile UI. A reason marked "Both" is displayed for all safety reports.
Tip: Scoping reasons to "Chat Only" or "Support Ticket Only" helps filter options correctly on the client and admin UIs.
</p>
</div>
</div>
@ -256,9 +256,7 @@ export default function ReportReasons({ reasons }) {
value={reasonType}
onChange={e => setReasonType(e.target.value)}
>
<option value="Both">Both (Chat & Review)</option>
<option value="Chat">Chat Only</option>
<option value="Review">Review Only</option>
<option value="Support">Support Ticket Only</option>
</select>
</div>

View File

@ -146,6 +146,7 @@
})->name('admin.skills.delete');
Route::get('/master-data/reasons', function () {
\DB::table('report_reasons')->whereIn('type', ['Both', 'Review'])->update(['type' => 'Chat']);
$reasons = \App\Models\ReportReason::orderBy('id', 'desc')->get()->map(function ($reason) {
return [
'id' => $reason->id,
@ -162,7 +163,7 @@
Route::post('/master-data/reasons', function (\Illuminate\Http\Request $request) {
$request->validate([
'reason' => 'required|string|max:255|unique:report_reasons,reason',
'type' => 'required|string|in:Chat,Review,Both,Support',
'type' => 'required|string|in:Chat,Support',
]);
\App\Models\ReportReason::create([
'reason' => $request->reason,
@ -176,7 +177,7 @@
$request->validate([
'reason' => 'required|string|max:255|unique:report_reasons,reason,' . $id,
'status' => 'required|string|in:Active,Inactive',
'type' => 'required|string|in:Chat,Review,Both,Support',
'type' => 'required|string|in:Chat,Support',
]);
$reason = \App\Models\ReportReason::findOrFail($id);
$reason->update([