Fix condition to translate directus collections (#9353)

* Fix condition to translate directus collections

* Check whether collection belongs to 'directus_collections'

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
Pascal Jufer
2021-11-02 21:16:09 +01:00
committed by GitHub
parent 2d4d923d78
commit bdbb604ff6

View File

@@ -292,7 +292,7 @@ export function useItem(collection: Ref<string>, primaryKey: Ref<string | number
}
function setItemValueToResponse(response: AxiosResponse) {
if (response.data.data.collection?.startsWith('directus_')) {
if (collection.value === 'directus_collections' && response.data.data.collection?.startsWith('directus_')) {
response.data.data = translate(response.data.data);
}
if (isBatch.value === false) {