Replace _id by id
This commit is contained in:
@@ -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