Replace _id by id
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user