Replace _id by id
This commit is contained in:
@@ -102,7 +102,7 @@ export default function MizikBadjMeni({teks}) {
|
||||
<Paper>
|
||||
<ClickAwayListener onClickAway={handleClose}>
|
||||
<MenuList autoFocusItem={open} id='menu-list-grow' onKeyDown={() => handleListKeyDown()}>
|
||||
{teks.map(t => <MenuItem key={t._id} onClick={() => handleClick(t.slug)}>{t.tit}</MenuItem>)}
|
||||
{teks.map(t => <MenuItem key={t.id} onClick={() => handleClick(t.slug)}>{t.tit}</MenuItem>)}
|
||||
</MenuList>
|
||||
</ClickAwayListener>
|
||||
</Paper>
|
||||
|
||||
@@ -18,7 +18,7 @@ const Alert = forwardRef(function Alert(props, ref) {
|
||||
})
|
||||
function EkriKomante({session, teks, meteEsKomanteOuve}) {
|
||||
const {jwt, user} = session
|
||||
const {_id} = teks
|
||||
const {id} = teks
|
||||
const [komante, meteKomante] = useState({kontni: ''})
|
||||
const [ere, meteEre] = useState('')
|
||||
const [sikse, meteSikse] = useState('')
|
||||
@@ -43,8 +43,8 @@ function EkriKomante({session, teks, meteEsKomanteOuve}) {
|
||||
|
||||
axios.post(`${API_URL}/komante`, {
|
||||
kontni,
|
||||
teks: _id,
|
||||
user: user._id
|
||||
teks: id,
|
||||
user: user.id
|
||||
}, {
|
||||
headers
|
||||
})
|
||||
|
||||
@@ -38,8 +38,8 @@ const StyledList = styled(List)((
|
||||
export default function KomanteList({komante}) {
|
||||
return (
|
||||
<StyledList className={classes.root}>
|
||||
{komante.map(({_id, username, kontni, sentAt}) => (
|
||||
<div key={_id}>
|
||||
{komante.map(({id, username, kontni, sentAt}) => (
|
||||
<div key={id}>
|
||||
<ListItemText
|
||||
primary={
|
||||
<Typography gutterBottom style={{fontWeight: 'bold'}} variant='body1'>
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function ResetDialog({lyen, title, activation, content, open, set
|
||||
|
||||
if (activation) {
|
||||
const user = await jwennUserEpiEmail(email)
|
||||
localStorage.setItem('user-id', user?._id)
|
||||
localStorage.setItem('user-id', user?.id)
|
||||
}
|
||||
|
||||
setLoading(false)
|
||||
|
||||
@@ -102,7 +102,7 @@ function Koneksyon({chimen}) {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
})
|
||||
localStorage.setItem('user-id', response?.data?.user?._id)
|
||||
localStorage.setItem('user-id', response?.data?.user?.id)
|
||||
setSuccess(true)
|
||||
resetRegisterForm()
|
||||
} catch (error_) {
|
||||
|
||||
@@ -37,8 +37,8 @@ function Chwa(props) {
|
||||
</Container>
|
||||
) : (
|
||||
<List sx={{pt: 0}}>
|
||||
{teksLis.length > 0 ? teksLis.map(({_id, tit, awtis}) => (
|
||||
<ListItem key={_id} button onClick={() => handleListItemClick(_id)}>
|
||||
{teksLis.length > 0 ? teksLis.map(({id, tit, awtis}) => (
|
||||
<ListItem key={id} button onClick={() => handleListItemClick(id)}>
|
||||
<ListItemAvatar>
|
||||
<Avatar sx={{bgcolor: green[100], color: green[600]}}>
|
||||
<AudiotrackIcon />
|
||||
@@ -78,14 +78,14 @@ export default function ChwaTeks({selectedTeks, setSelectedTeks}) {
|
||||
setOpen(true)
|
||||
setLoading(true)
|
||||
|
||||
const jwennTeks = await jwennTeksEpiUserId(user._id)
|
||||
const jwennTeks = await jwennTeksEpiUserId(user.id)
|
||||
|
||||
setTeksLis(jwennTeks)
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
const handleClose = value => {
|
||||
const teks = teksLis.find(({_id}) => _id === value)
|
||||
const teks = teksLis.find(({id}) => id === value)
|
||||
setSelectedTeks(teks)
|
||||
setOpen(false)
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ function EkriTeks({canAutoTranslate, selectedTeks, setSelectedTeks}) {
|
||||
if (currentTeksId) {
|
||||
axios.get(`${API_URL}/teks/${currentTeksId}?_publicationState=preview&_where[published_at_null]=true`)
|
||||
.then(awtisResponse => {
|
||||
if (awtisResponse.data.user._id !== user._id) {
|
||||
if (awtisResponse.data.user.id !== user.id) {
|
||||
setLoading(false)
|
||||
return setError({message: 'Opération non autorisée'})
|
||||
}
|
||||
@@ -182,7 +182,7 @@ function EkriTeks({canAutoTranslate, selectedTeks, setSelectedTeks}) {
|
||||
italiano: it === '' ? null : it
|
||||
},
|
||||
user,
|
||||
awtis: [awtisResponse.data._id],
|
||||
awtis: [awtisResponse.data.id],
|
||||
tradiksyonOtomatik
|
||||
}, {
|
||||
headers
|
||||
@@ -228,7 +228,7 @@ function EkriTeks({canAutoTranslate, selectedTeks, setSelectedTeks}) {
|
||||
useEffect(() => {
|
||||
if (selectedTeks) {
|
||||
setTradiksyonOtomatik(false)
|
||||
setCurrentTeksId(selectedTeks._id)
|
||||
setCurrentTeksId(selectedTeks.id)
|
||||
setTeksEkri({
|
||||
awtis: new Intl.ListFormat('fr').format(selectedTeks.awtis.map(({alias}) => alias)),
|
||||
tit: selectedTeks.tit,
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function DenyeTeks(teks) {
|
||||
<Root className={classes.container}>
|
||||
<Container>
|
||||
<Grid container spacing={3}>
|
||||
{teksKlasePaPibilikasyon.map(t => <TeksKat key={t._id} teks={t} />)}
|
||||
{teksKlasePaPibilikasyon.map(t => <TeksKat key={t.id} teks={t} />)}
|
||||
</Grid>
|
||||
</Container>
|
||||
</Root>
|
||||
|
||||
@@ -121,9 +121,9 @@ function EntegreMizik({anTeks, isMobile}) {
|
||||
|
||||
return (
|
||||
<Box align='center'>
|
||||
{!okiMizikID && filteredKouteyAchtey.map(({_id, boutik, url}) => (
|
||||
{!okiMizikID && filteredKouteyAchtey.map(({id, boutik, url}) => (
|
||||
<IconButton
|
||||
key={_id}
|
||||
key={id}
|
||||
aria-label='player'
|
||||
size='large'
|
||||
onClick={() => handleClick(boutik, url)}
|
||||
|
||||
Reference in New Issue
Block a user