Compare commits
No commits in common. "55f49acca295ae5b278814724c7781e35f0e7405" and "3fcd8d54a0441716e86a60873478937d33fe3706" have entirely different histories.
55f49acca2
...
3fcd8d54a0
@ -30,7 +30,6 @@ public function run(): void
|
|||||||
// Call Seeders
|
// Call Seeders
|
||||||
$this->call([
|
$this->call([
|
||||||
SkillSeeder::class,
|
SkillSeeder::class,
|
||||||
AdminSeeder::class,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,14 +32,14 @@ export default function ReportReasons({ reasons }) {
|
|||||||
const [editingReason, setEditingReason] = useState(null);
|
const [editingReason, setEditingReason] = useState(null);
|
||||||
const [reasonName, setReasonName] = useState('');
|
const [reasonName, setReasonName] = useState('');
|
||||||
const [reasonStatus, setReasonStatus] = useState('Active');
|
const [reasonStatus, setReasonStatus] = useState('Active');
|
||||||
const [reasonType, setReasonType] = useState('Chat');
|
const [reasonType, setReasonType] = useState('Both');
|
||||||
const [error, setError] = useState('');
|
const [error, setError] = useState('');
|
||||||
|
|
||||||
const handleOpenAdd = () => {
|
const handleOpenAdd = () => {
|
||||||
setEditingReason(null);
|
setEditingReason(null);
|
||||||
setReasonName('');
|
setReasonName('');
|
||||||
setReasonStatus('Active');
|
setReasonStatus('Active');
|
||||||
setReasonType('Chat');
|
setReasonType('Both');
|
||||||
setError('');
|
setError('');
|
||||||
setIsDialogOpen(true);
|
setIsDialogOpen(true);
|
||||||
};
|
};
|
||||||
@ -48,7 +48,7 @@ export default function ReportReasons({ reasons }) {
|
|||||||
setEditingReason(reason);
|
setEditingReason(reason);
|
||||||
setReasonName(reason.reason);
|
setReasonName(reason.reason);
|
||||||
setReasonStatus(reason.status);
|
setReasonStatus(reason.status);
|
||||||
setReasonType(reason.type || 'Chat');
|
setReasonType(reason.type || 'Both');
|
||||||
setError('');
|
setError('');
|
||||||
setIsDialogOpen(true);
|
setIsDialogOpen(true);
|
||||||
};
|
};
|
||||||
@ -218,7 +218,7 @@ export default function ReportReasons({ reasons }) {
|
|||||||
<div className="flex items-start space-x-3 text-slate-400">
|
<div className="flex items-start space-x-3 text-slate-400">
|
||||||
<Info className="w-4 h-4 shrink-0 mt-0.5" />
|
<Info className="w-4 h-4 shrink-0 mt-0.5" />
|
||||||
<p className="text-[10px] font-bold uppercase tracking-wide leading-relaxed">
|
<p className="text-[10px] font-bold uppercase tracking-wide leading-relaxed">
|
||||||
Tip: Scoping reasons to "Chat Only" or "Support Ticket Only" helps filter options correctly on the client and admin UIs.
|
Tip: Scoping reasons to "Chat" or "Review" helps filter options on the mobile UI. A reason marked "Both" is displayed for all safety reports.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -256,7 +256,9 @@ export default function ReportReasons({ reasons }) {
|
|||||||
value={reasonType}
|
value={reasonType}
|
||||||
onChange={e => setReasonType(e.target.value)}
|
onChange={e => setReasonType(e.target.value)}
|
||||||
>
|
>
|
||||||
|
<option value="Both">Both (Chat & Review)</option>
|
||||||
<option value="Chat">Chat Only</option>
|
<option value="Chat">Chat Only</option>
|
||||||
|
<option value="Review">Review Only</option>
|
||||||
<option value="Support">Support Ticket Only</option>
|
<option value="Support">Support Ticket Only</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -146,7 +146,6 @@
|
|||||||
})->name('admin.skills.delete');
|
})->name('admin.skills.delete');
|
||||||
|
|
||||||
Route::get('/master-data/reasons', function () {
|
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) {
|
$reasons = \App\Models\ReportReason::orderBy('id', 'desc')->get()->map(function ($reason) {
|
||||||
return [
|
return [
|
||||||
'id' => $reason->id,
|
'id' => $reason->id,
|
||||||
@ -163,7 +162,7 @@
|
|||||||
Route::post('/master-data/reasons', function (\Illuminate\Http\Request $request) {
|
Route::post('/master-data/reasons', function (\Illuminate\Http\Request $request) {
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'reason' => 'required|string|max:255|unique:report_reasons,reason',
|
'reason' => 'required|string|max:255|unique:report_reasons,reason',
|
||||||
'type' => 'required|string|in:Chat,Support',
|
'type' => 'required|string|in:Chat,Review,Both,Support',
|
||||||
]);
|
]);
|
||||||
\App\Models\ReportReason::create([
|
\App\Models\ReportReason::create([
|
||||||
'reason' => $request->reason,
|
'reason' => $request->reason,
|
||||||
@ -177,7 +176,7 @@
|
|||||||
$request->validate([
|
$request->validate([
|
||||||
'reason' => 'required|string|max:255|unique:report_reasons,reason,' . $id,
|
'reason' => 'required|string|max:255|unique:report_reasons,reason,' . $id,
|
||||||
'status' => 'required|string|in:Active,Inactive',
|
'status' => 'required|string|in:Active,Inactive',
|
||||||
'type' => 'required|string|in:Chat,Support',
|
'type' => 'required|string|in:Chat,Review,Both,Support',
|
||||||
]);
|
]);
|
||||||
$reason = \App\Models\ReportReason::findOrFail($id);
|
$reason = \App\Models\ReportReason::findOrFail($id);
|
||||||
$reason->update([
|
$reason->update([
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user