make i.user_created optional

This commit is contained in:
Anton Tranelis 2024-04-23 22:22:51 +02:00
parent 7af09ce106
commit 2eade19cd5
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
map.closePopup(); map.closePopup();
} }
else { else {
const item = items.find(i => i.user_created.id === user?.id && i.layer?.itemType.name === props.layer.itemType.name); const item = items.find(i => i.user_created?.id === user?.id && i.layer?.itemType.name === props.layer.itemType.name);
console.log(item); console.log(item);
const uuid = crypto.randomUUID(); const uuid = crypto.randomUUID();

View File

@ -77,7 +77,7 @@ function usePermissionsManager(initialPermissions: Permission[]): {
p.permissions._and.some(condition => p.permissions._and.some(condition =>
condition.user_created && condition.user_created &&
condition.user_created._eq === "$CURRENT_USER" && condition.user_created._eq === "$CURRENT_USER" &&
item.user_created.id === user?.id item.user_created?.id === user?.id
) )
) )
); );