Fix api call for insights list panel (#18631)

* fix api call for panel list

* Create many-shoes-pull.md
This commit is contained in:
Brainslug
2023-05-16 19:50:45 +02:00
committed by GitHub
parent 377b2889ec
commit bc66343e20
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@directus/app": patch
---
Fixed api endpoint for insights list panel

View File

@@ -31,6 +31,7 @@ import api from '@/api';
import { useFieldsStore } from '@/stores/fields';
import { useInsightsStore } from '@/stores/insights';
import { unexpectedError } from '@/utils/unexpected-error';
import { getEndpoint } from '@directus/utils';
const props = withDefaults(
defineProps<{
@@ -70,7 +71,7 @@ function cancelEdit() {
async function saveEdits(item: Record<string, any>) {
try {
await api.patch(`/items/${props.collection}/${currentlyEditing.value}`, item);
await api.patch(`${getEndpoint(props.collection)}/${currentlyEditing.value}`, item);
} catch (err: any) {
unexpectedError(err);
}