mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-03-01 12:44:17 +00:00
fix linting
This commit is contained in:
parent
fe2ed8be28
commit
2d0b3079ea
@ -11,8 +11,6 @@
|
||||
import { createContext, useContext, useEffect, useState, useCallback } from 'react'
|
||||
import { toast } from 'react-toastify'
|
||||
|
||||
import { useAuth } from '#components/Auth/useAuth'
|
||||
|
||||
import { useUpdateItem } from './useItems'
|
||||
import { useLayers } from './useLayers'
|
||||
import { useHasUserPermission } from './usePermissions'
|
||||
@ -49,7 +47,6 @@ function useSelectPositionManager(): {
|
||||
const updateItem = useUpdateItem()
|
||||
const hasUserPermission = useHasUserPermission()
|
||||
const layers = useLayers()
|
||||
const { user } = useAuth()
|
||||
|
||||
// Handle API operations with consistent error handling and return response data
|
||||
const handleApiOperation = useCallback(
|
||||
|
||||
@ -198,8 +198,8 @@ export function ProfileForm() {
|
||||
state={state}
|
||||
setState={setState}
|
||||
updatePermission={updatePermission}
|
||||
linkItem={(id: string) => linkItem(id, item, updateItem, user)}
|
||||
unlinkItem={(id: string) => unlinkItem(id, item, updateItem, user)}
|
||||
linkItem={(id: string) => linkItem(id, item, updateItem)}
|
||||
unlinkItem={(id: string) => unlinkItem(id, item, updateItem)}
|
||||
setUrlParams={setUrlParams}
|
||||
></TabsForm>
|
||||
)}
|
||||
|
||||
@ -12,7 +12,6 @@ import { useEffect, useState } from 'react'
|
||||
import { useMap } from 'react-leaflet'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
|
||||
import { useAuth } from '#components/Auth/useAuth'
|
||||
import { useClusterRef } from '#components/Map/hooks/useClusterRef'
|
||||
import { useItems, useRemoveItem, useUpdateItem } from '#components/Map/hooks/useItems'
|
||||
import { useLayers } from '#components/Map/hooks/useLayers'
|
||||
@ -52,7 +51,6 @@ export function ProfileView({ attestationApi }: { attestationApi?: ItemsApi<any>
|
||||
const map = useMap()
|
||||
const selectPosition = useSelectPosition()
|
||||
const removeItem = useRemoveItem()
|
||||
const { user } = useAuth()
|
||||
const tags = useTags()
|
||||
const navigate = useNavigate()
|
||||
const hasUserPermission = useHasUserPermission()
|
||||
@ -210,8 +208,8 @@ export function ProfileView({ attestationApi }: { attestationApi?: ItemsApi<any>
|
||||
needs={needs}
|
||||
relations={relations}
|
||||
updatePermission={updatePermission}
|
||||
linkItem={(id) => linkItem(id, item, updateItem, user)}
|
||||
unlinkItem={(id) => unlinkItem(id, item, updateItem, user)}
|
||||
linkItem={(id) => linkItem(id, item, updateItem)}
|
||||
unlinkItem={(id) => unlinkItem(id, item, updateItem)}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
||||
@ -116,7 +116,7 @@ export const submitNewItem = async (
|
||||
setAddItemPopupType('')
|
||||
}
|
||||
|
||||
export const linkItem = async (id: string, item: Item, updateItem, user) => {
|
||||
export const linkItem = async (id: string, item: Item, updateItem) => {
|
||||
const newRelations = item.relations ?? []
|
||||
newRelations?.push({ items_id: item.id, related_items_id: id })
|
||||
const updatedItem = { id: item.id, relations: newRelations }
|
||||
@ -145,7 +145,7 @@ export const linkItem = async (id: string, item: Item, updateItem, user) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const unlinkItem = async (id: string, item: Item, updateItem, user) => {
|
||||
export const unlinkItem = async (id: string, item: Item, updateItem) => {
|
||||
const newRelations = item.relations?.filter((r) => r.related_items_id !== id)
|
||||
const updatedItem = { id: item.id, relations: newRelations }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user