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