fix(dev): stub /api/* in vite dev to avoid @vercel/kv transform crash; allow owners to create map entries

This commit is contained in:
Satyam Rastogi
2026-05-29 01:32:55 +05:30
parent 73387366fe
commit 97597737df
2 changed files with 35 additions and 3 deletions
+2 -2
View File
@@ -231,8 +231,8 @@ function Maps() {
// 2. Click Empty Map (Create New)
const handleMapCreate = async (latlng) => {
// Only Field Agents (employees) can create
if (user?.role !== 'FIELD_AGENT' && user?.role !== 'ADMIN') return;
// Field Agents, Admins, and Owners can create new map entries
if (!['FIELD_AGENT', 'ADMIN', 'OWNER'].includes(user?.role)) return;
setSelectedPropertyId(null);
setNewPropertyLocation({ lat: latlng.lat, lng: latlng.lng, address: '' });