fix(dev): stub /api/* in vite dev to avoid @vercel/kv transform crash; allow owners to create map entries
This commit is contained in:
+2
-2
@@ -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: '' });
|
||||
|
||||
Reference in New Issue
Block a user