fix: role restrictions use localStorage fallback; request text body size not h1 bold

This commit is contained in:
James 2026-03-12 04:54:42 -04:00
parent e197bb9526
commit d3f3360c48
3 changed files with 6 additions and 12 deletions

Binary file not shown.

Binary file not shown.

View File

@ -18,12 +18,9 @@
<!-- LEFT: Request -->
<div class="lg:col-span-7 bg-[#0d1f3c] border border-white/[0.08] rounded-xl p-6">
<div class="flex items-center gap-2 mb-5">
<span class="text-lg">&#128203;</span>
<h2 class="text-sm font-semibold text-[#94a3b8] uppercase tracking-wider">Request</h2>
</div>
<div class="flex items-start gap-3 mb-4">
<h1 id="reqTitle" class="text-base font-semibold text-white leading-snug flex-1">Loading...</h1>
<p id="reqTitle" class="text-sm text-white leading-relaxed flex-1">Loading...</p>
<button id="editReqBtn" onclick="startEditRequest()" class="shrink-0 p-1.5 rounded-lg hover:bg-white/[0.08] text-[#94a3b8] hover:text-white transition" title="Edit request">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"/></svg>
</button>
@ -76,10 +73,7 @@
<!-- RIGHT: Response -->
<div class="lg:col-span-5 bg-[#0d1f3c] border border-white/[0.08] rounded-xl p-6 flex flex-col">
<div class="flex items-center gap-2 mb-5">
<span class="text-lg">&#128193;</span>
<h2 class="text-sm font-semibold text-[#94a3b8] uppercase tracking-wider">Response</h2>
</div>
<div id="answeredBanner" class="hidden mb-4 px-4 py-2.5 rounded-lg bg-green-500/10 border border-green-500/20 text-green-300 text-sm font-medium flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>
Answered
@ -137,9 +131,9 @@
async function applyRoleRestrictions() {
try {
const res = await fetchAPI('/api/auth/me');
if (!res.ok) return;
const me = await res.json();
const role = me.test_role || '';
const me = res.ok ? await res.json() : {};
// Use server role first, fall back to localStorage (survives service restarts)
const role = me.test_role || localStorage.getItem('ds_test_role') || '';
const isReadOnly = role === 'buyer' || role === 'seller' || role === 'advisor';
if (isReadOnly) {
const ua = document.getElementById('uploadArea');